MYSQL»ù´¡Ö®Á¬½ÓMYSQL¡¢ÐÞ¸ÄÃÜÂë¡¢Ìí¼ÓÓû§
Ò»¡¢Á¬½ÓMYSQL¡£
¸ñʽ£º mysql -hÖ÷»úµØÖ· -uÓû§Ãû £pÓû§ÃÜÂë
1¡¢Àý1£ºÁ¬½Óµ½±¾»úÉϵÄMYSQL¡£
Ê×ÏÈÔÚ´ò¿ªDOS´°¿Ú£¬È»ºó½øÈëĿ¼ mysqlbin£¬ÔÙ¼üÈëÃüÁîmysql -uroot -p£¬»Ø³µºóÌáʾÄãÊäÃÜÂ룬Èç¹û¸Õ°²×°ºÃMYSQL£¬³¬¼¶Óû§rootÊÇûÓÐÃÜÂëµÄ£¬¹ÊÖ±½Ó»Ø³µ¼´¿É½øÈëµ½MYSQLÖÐÁË£¬MYSQLµÄÌáʾ·ûÊÇ£ºmysql>
2¡¢Àý2£ºÁ¬½Óµ½Ô¶³ÌÖ÷»úÉϵÄMYSQL¡£¼ÙÉèÔ¶³ÌÖ÷»úµÄIPΪ£º110.110.110.110£¬Óû§ÃûΪroot,ÃÜÂëΪabcd123¡£Ôò¼üÈëÒÔÏÂÃüÁ
mysql -h110.110.110.110 -uroot -pabcd123
£¨×¢:uÓëroot¿ÉÒÔ²»Óüӿոñ£¬ÆäËüÒ²Ò»Ñù£©
3¡¢Í˳öMYSQLÃüÁ exit £¨»Ø³µ£©
¶þ¡¢ÐÞ¸ÄÃÜÂë¡£
¸ñʽ£ºmysqladmin -uÓû§Ãû -p¾ÉÃÜÂë password ÐÂÃÜÂë
1¡¢Àý1£º¸øroot¼Ó¸öÃÜÂëab12¡£Ê×ÏÈÔÚDOSϽøÈëĿ¼mysqlbin£¬È»ºó¼üÈëÒÔÏÂÃüÁî
mysqladmin -uroot -password ab12
×¢£ºÒòΪ¿ªÊ¼Ê±rootûÓÐÃÜÂ룬ËùÒÔ-p¾ÉÃÜÂëÒ»Ïî¾Í¿ÉÒÔÊ¡ÂÔÁË¡£
2¡¢Àý2£ºÔÙ½«rootµÄÃÜÂë¸ÄΪdjg345¡£
mysqladmin -uroot -pab12 password djg345
Èý¡¢Ôö¼ÓÐÂÓû§¡££¨×¢Ò⣺ºÍÉÏÃ治ͬ£¬ÏÂÃæµÄÒòΪÊÇMYSQL»·¾³ÖеÄÃüÁËùÒÔºóÃ涼´øÒ»¸ö·ÖºÅ×÷ΪÃüÁî½áÊø·û£©
¸ñʽ£ºgrant select on Êý¾Ý¿â.* to Óû§Ãû@µÇ¼Ö÷»ú identified by “ÃÜÂë”
Àý1¡¢Ôö¼ÓÒ»¸öÓû§test1ÃÜÂëΪabc£¬ÈÃËû¿ÉÒÔÔÚÈκÎÖ÷»úÉϵǼ£¬²¢¶ÔËùÓÐÊý¾Ý¿âÓвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄȨÏÞ¡£Ê×ÏÈÓÃÒÔrootÓû§Á¬ÈëMYSQL£¬È»ºó¼üÈëÒÔÏÂÃüÁ
grant select,insert,update,delete on *.* to test1@”%” Identified by “abc”;
µ«Àý1Ôö¼ÓµÄÓû§ÊÇÊ®·ÖΣÏյģ¬ÄãÏëÈçij¸öÈËÖªµÀtest1µÄÃÜÂ룬ÄÇôËû¾Í¿ÉÒÔÔÚinternetÉϵÄÈκÎһ̨µçÄÔÉϵǼÄãµÄmysqlÊý¾Ý¿â²¢¶ÔÄãµÄÊý¾Ý¿ÉÒÔΪËùÓûΪÁË£¬½â¾ö°ì·¨¼ûÀý2¡£
Àý2¡¢Ôö¼ÓÒ»¸öÓû§test2ÃÜÂëΪabc,ÈÃËûÖ»¿ÉÒÔÔÚlocalhostÉϵǼ£¬²¢¿ÉÒÔ¶ÔÊý¾Ý¿âmydb½øÐвéѯ¡¢²åÈë¡¢Ð޸ġ¢É¾³ýµÄ²Ù×÷£¨localhostÖ¸±¾µØÖ÷»ú£¬¼´MYSQLÊý¾Ý¿âËùÔÚµÄÄÇ̨Ö÷»ú£©£¬ÕâÑùÓû§¼´Ê¹ÓÃÖªµÀtest2µÄÃÜÂ룬ËûÒ²ÎÞ·¨´ÓinternetÉÏÖ±½Ó·ÃÎÊÊý¾Ý¿â£¬Ö»ÄÜͨ¹ýMYSQLÖ÷»úÉϵÄwebÒ³À´·ÃÎÊÁË¡£
grant select,insert,update,delete on mydb.* to test2@localhost identified by “abc”;
Èç¹ûÄã²»Ïëtest2ÓÐÃÜÂ룬¿ÉÒÔÔÙ´òÒ»¸öÃüÁÃÜÂëÏûµô¡£
grant select,insert,update,delete on mydb.* to test2@localhost identified by “”;
Ïà¹ØÎĵµ£º
1¡¢ÆÕͨË÷Òý
¡¡¡¡ÆÕͨË÷Òý£¨Óɹؼü×ÖKEY»òINDEX¶¨ÒåµÄË÷Òý£©µÄΨһÈÎÎñÊǼӿì¶ÔÊý¾ÝµÄ·ÃÎÊËٶȡ£Òò´Ë£¬Ó¦¸ÃֻΪÄÇЩ×î¾³£³öÏÖÔÚ²éѯÌõ¼þ£¨WHEREcolumn=£©»òÅÅÐòÌõ¼þ£¨ORDERBYcolumn£©ÖеÄÊý¾ÝÁд´½¨Ë÷Òý¡£Ö»ÒªÓпÉÄÜ£¬¾ÍÓ¦¸ÃÑ¡ÔñÒ»¸öÊý¾Ý×îÕûÆë¡¢×î½ô´ÕµÄÊý¾ÝÁУ¨ÈçÒ»¸öÕûÊýÀàÐ͵ÄÊý¾ÝÁУ©À´´´½¨Ë÷Òý¡£
¡¡¡¡2¡¢Î¨Ò»Ë÷Òý
......
1.MemoryÒýÇæ,ÌṩÄÚ´æ±í
MySql Memory´æ´¢ÒýÇ棨ÀÏ°æ±¾Ò²½Ð×öheap´æ´¢ÒýÇ棩£¬¹ËÃû˼ÒåÊÇÔÚÄÚ´æÖд洢ËùÓеÄÊý¾Ý£¬Ëü¾ßÓÐÒÔÏÂÁ½¸öÃ÷ÏÔÌØÕ÷£º
¢ÙÄÚ´æÖд洢Êý¾Ý£¬·Ç³£¸ßËÙ;
¢Úmysql¹Ø±ÕºóËùÓÐÊý¾ÝÏûʧ£¬mysqlÆô¶¯Ê±»á´´ ......
¸ñʽÎļþ .frm ÃèÊö±íµÄ½á¹¹£¨ÁС¢ÁÐÀàÐÍ¡¢Ë÷Òý£¬µÈµÈ£©
Êý¾ÝÎļþ .ISD(ISAM) »ò .MYD (MyISAM) °üº¬±íµÄÊý¾Ý©¤¼´ËüµÄÐÐ
Ë÷ÒýÎļþ ISD(ISAM) »ò .MYI (MyISAM) °üº¬Êý¾ÝÎļþÖÐÈκÎË÷ÒýµÄË÷ÒýÊ÷¡£ÎÞÂ۸ñíÓÐÎÞË÷Òý£¬Ë÷ÒýÎļþ¶¼´æÔÚ
......
1.Ö±½ÓÔÚÊý¾Ý¿âÖÐÐ޸ļǼ
mysql> use mysql
mysql> update user set password = password(”new_password”) where user = “user_name”;
mysql> flush privileges;
ÆäʵÕâÖÖ·½·¨¾ÍÊǸüÐÂÒ»ÌõÊý¾Ý¿â¼Ç¼£¬ÓëÆÕͨupdateÓï¾ä²»Í¬µÄÊÇ£¬ÃÜÂë¼ÓÃÜ´æ´¢£¬ÐèÓÃpassword()º¯ÊýÀ´Éú³É£¬ÁíÒ»¸ö²»Í ......