¿ªÊ¼ÊÕ¼¯mysqlµÄ¸÷ÖÖÃüÁî
ÕâÀïÊÕ¼¯¸÷ÖÖMysqlµÄ»ù´¡ÖªÊ¶,ΪÁËijЩ³¡ºÏµÄÐèÒª,»¹ÊÇÉáÆúnavicatÖ®ÀàµÄ¹¤¾ß¹Ô¹ÔÓÃÃüÁîÐаÉ
£¨×¢ÒâÓеÄÃüÁîÐèÒª·ÖºÅÓеIJ»ÐèÒª)
Ò».»ù±¾²Ù×÷
1.怬
mysql -u Óû§Ãû -pÃÜÂë Êý¾Ý¿âÃû
ÕâÀïÐèҪעÒâµÄÊÇ-uÓû§ÃûÖ®¼ä¿ÉÒÔÓпոñ,¶ø-pÃÜÂëÖ®¼ä¾ö²»ÄÜÓпոñ,Äã¿ÉÒÔ²»ÌîÃÜÂë,µ±È»Óû§ÃûÄãÒ²¿ÉÒÔ²»Ìî,µ«ÊÇ»áÒÔ¿ÕµÄÓÃ
»§ÃûÀ´µÇ¼,È»ºó²Ù×÷Êý¾Ý¿âµÄʱºò»áÓкܶàÏÞÖÆ,ÖîÈçÖ®ÀàµÄAccess denied for user ''@'localhost' to database´íÎó.
»¹ÓÐ,²»ÒªÔÚºóÃæ¼Ó·ÖºÅ;
2.´´½¨Óû§
grant ȨÏÞ on Êý¾Ý¿â.* to Óû§Ãû@µÇ¼Ö÷»ú identified by "ÃÜÂë";
ÕâÀï×¢ÒâµÄÊÇÒ»¶¨ÒªÊÇ×îºÜ¸ßȨÏÞµÄÓû§²Å¿ÉÒÔ²Ù×÷,Ò»°ã¾ÍÊÇroot,²»ÏÓÂé·³µÄ»°Ò²¿ÉÒÔÖ±½ÓÇÐÈëmysqlÕâ¸öÊý¾Ý¿â°ÑÊý¾ÝÌí¼Ó½ø
user±íÀï.ÕâÀï¸ø¸öÀý×Ó:grant select,insert,update,delete on *.* to Rye@loaclhost Identified by "1234"
Èç¹ûÏ£Íû¸ÃÓû§Äܹ»ÔÚÈκλúÆ÷Éϵǽmysql£¬Ôò½«localhost¸ÄΪ"%".
3.´´½¨³¬¼¶Óû§
grant all privileges on *.* to Óû§Ãû@µÇ¼Ö÷»ú identified by "ÃÜÂë" with grant options;
4.ÐÞ¸ÄÓû§
ÃüÁîÓëÉÏÃæÒ»Ñù,¿ÉÒÔÐÞ¸ÄȨÏÞºÍÃÜÂë
5.ÐÞ¸Äroot ÃÜÂë
Õâ¸öʱºòÒªÔÚδµÇ¼µÄ״̬ÏÂ(Ò²¾ÍÊÇÏÈexitÍ˳ö)ʹÓÃÃüÁî mysqladmin -u Óû§Ãû -pÃÜÂë password ÐÂÃÜÂë
6.¹Ø±ÕÆô¶¯
net stop mysql (δµÇ¼״̬ÏÂ) ¹Ø±Õmysql
net start mysql (δµÇ¼״̬ÏÂ) ¿ªÆômysql
7.Í˳ömysql
quite»òÕßexit
¶þ.²Ù×÷Êý¾Ý¿â
1.show databases; ÏÔʾ¿É¹©²Ù×÷µÄÊý¾Ý¿â£¬ÓÐʱºòÄã»á·¢ÏÖ²¢Ã»ÓÐÏÔÊ¾È«Ãæ,ÄÇÊÇÒòΪȨÏÞ²»¹»¡£
2.use Êý¾Ý¿âÃû; &nb
Ïà¹ØÎĵµ£º
1 ÄÚ´æ±íµÄ±í»ú¹¹»¹ÊÇÔÚÊý¾Ý¿âÖеģ¬Ö»ÊÇÊý¾Ýʱ·ÅÔÚÄÚ´æÖеġ£
2 ÄÚ´æ±íÖв»¿ÉÒÔʹÓÃTEXTºÍBLOBÀàÐ͵Ä×ֶΡ£
3 ÄÚ´æ±í¿ÉÒÔͨ¹ýmax_heap_table_size = 2048MÀ´¼Ó´óʹÓõÄÄÚ´æ¡£
1 ÁÙʱ±íµÄ±í»ú¹¹ºÍÊý¾Ý¶¼ÊÇ·ÅÔÚÄÚ´æÖеÄ
¾ßÌå¼ûÏ£º
ÄÚ´æ±íʹÓùþϣɢÁÐË÷Òý°ÑÊý¾Ý±£´æÔÚÄÚ´æÖУ¬Òò´Ë¾ßÓм«¿ìµÄËÙ¶È£¬Êʺϻº´æÖÐСÐÍÊý¾Ý¿ ......
¾ÍÎÒÖªµÀµÄÁ½¸öÇø±ð£º
myISAM ²»Ö§³ÖÊÂÎñ
Innodb Ö§³ÖÊÂÎñ
Èç¹ûÐÞ¸ÄmyISAM ΪInnodb£¬ÐèÒª°ÑÔÀ´µÄÊý¾ÝÏÈdump³öÀ´£¬Çå¿Õ±í£¬ÔÚÖØÐ²åÈë
innodbÔÚ/etc/my.cfgµÄÅäÖÃΪ
innodb_data_home_dir = /var/lib/mysql/
innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
innodb_log_group_hom ......
½ñÌìÓöµ½Êý¾Ý¿âµÄÒ»¸öÎÊÌ⣬¾ÍÊÇÿµ±´ÓÖ÷±íÖÐɾ³ýÒ»¸öÖ÷¼üidʱ£¬ÓÉÓÚÓëËûÏà¹ØÁªµÄ±íÖÐÓÐÏà¹ØµÄ×Ö¶ÎÊý¾Ý£¬ËùÒÔÎÞ·¨É¾³ý¡£²éÁËÒ»´ó¶Ñ×ÊÁÏ£¬·¢ÏÖÎÒ½¨±í¹ØÁªÓõÄÊÇon Restrict.¿ÉÄÜÎÊÌâ¾Í³öÔÚÕâÀï°É¡£
Íâ¼üÔ¼Êø¶Ô×Ó±íµÄº¬Òå:
Èç¹ûÔÚ¸¸±íÖÐÕÒ²»µ½ºòÑ¡¼ü,Ôò²»ÔÊÐíÔÚ×Ó±íÉϽøÐÐinsert/update
Íâ¼üÔ¼Êø ......
×î½üÓÃmysqlдÁ˼¸¸ö¸´ÔÓµÄÓï¾ä£¬¸Ð¾õÔÚ¹ØÏµºÜ¸´ÔÓµÄʱºòÏÈÀíÇå¹ØÏµÔÙÑ¡ÔñÓõIJéѯ·½·¨ÊǺÜÖØÒªµÄ£¬ÒòΪͬһ¸öÐèÇó¿ÉÄÜÓò»Í¬µÄ·½·¨À´²é³öÀ´£¬µ«ÊǸ´ÔÓ¶È£¬ÐÔÄܶ¼²»Ò»Ñù¡£
ÏÂÃæËµÒ»ÏÂÄÜʵÏÖ¸´ÔÓ²éѯµÄһЩһ°ã·½·¨£º
Ò».withÓï·¨£¨Ê×ÏÈ˵Ã÷£¬ºÃÏñMysql²»Ö§³ÖÕâ¸öÓï ......
ÎÒд¹ýµÄ½Ì³Ì²»¶à£¬¶øÇҴ󲿷ֶ¼ÊÇÀ´Ô´ÓÚ±ðÈ˵Ľ̳̣¬²»¹ý£¬ÕâÀïËù½éÉܵ쬶¼ÊÇÈÚÈëÎÒËù×ܽáµÄ¾Ñ飮££ÒýÑÔ
¡¡¡¡
¡¡¡¡PHPµÄÖ´ÐÐЧÂÊÊÇÓÐÄ¿¹²¶ÃµÄ£¬ÕâÒ²ÊÇÎÒϲ»¶ËüµÄÔÒòÖ®Ò»£¬ºÍËü³ÆÎª¾øÃî´îµµµÄMysqlÒÔ¼°ApacheÏëÈںϣ¬²»Äܲ»¾ªÌ¾ÆäЧÂÊÁË¡£PHP¸üÐÂÒ²ºÜ¿ì£¬ÕâÀïÁоÙÁËĿǰ×îа汾PHP4.3.2RC4£¨¼¸ºõûÓÐBUGÁË£¬¹À¼ÆÐ´Í ......