Ô¶³ÌÁ¬½Ó MySQL l×ÊÁÏ zz
Ô¶³ÌÁ¬½Ómysql×ÊÁÏ
Ô¶³ÌÁ¬½Óµ½mysqlÐèÒª×öµÄ£º
1¡¢½øÈëmysql£¬´´½¨Ò»¸öÐÂÓû§xuys£º
¸ñʽ£ºgrant ȨÏÞ on Êý¾Ý¿âÃû.±íÃû Óû§@µÇ¼Ö÷»ú identified by "Óû§ÃÜÂë";
grant select,update,insert,delete on *.* to xuys@192.168.88.234 identified by "xuys1234";
²é¿´½á¹û£¬Ö´ÐУº
use mysql;
select host,user,password from user;
¿ÉÒÔ¿´µ½ÔÚuser±íÖÐÒÑÓиղŴ´½¨µÄxuysÓû§¡£host×ֶαíʾµÇ¼µÄÖ÷»ú£¬ÆäÖµ¿ÉÒÔÓÃIP£¬Ò²¿ÉÓÃÖ÷»úÃû£¬½«host×ֶεÄÖµ¸ÄΪ%¾Í±íʾÔÚÈκοͻ§¶Ë»úÆ÷ÉÏÄÜÒÔxuysÓû§µÇ¼µ½mysql·þÎñÆ÷£¬½¨ÒéÔÚ¿ª·¢Ê±ÉèΪ%¡£
update user set host = '%' where user = 'xuys';
2¡¢ ./mysqladmin -uroot -ppwd reload
./mysqladmin -uroot -ppwd shutdown
3¡¢./mysqld_safe --user=root &
¼Çס£º¶ÔÊÚȨ±íµÄÈκÎÐ޸Ķ¼ÐèÒªÖØÐÂreload£¬¼´Ö´ÐеÚ3²½¡£
Èç¹û¾¹ýÒÔÉÏ3¸ö²½Ö軹ÊÇÎÞ·¨´Ó¿Í»§¶ËÁ¬½Ó£¬ÇëÖ´ÐÐÒÔϲÙ×÷£¬ÔÚmysqlÊý¾Ý¿âµÄdb±íÖвåÈëÒ»Ìõ¼Ç¼£º
use mysql;
insert into db
values('192.168.88.234','%','xuys','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
update db set host = '%' where user = 'xuys';
Öظ´Ö´ÐÐÉÏÃæµÄµÚ2¡¢3²½¡£
Ïà¹ØÎĵµ£º
Äã¿ÉÒÔ´´½¨Ò»¸öÎı¾Îļþ“pet.txt”£¬Ã¿Ðаüº¬Ò»¸ö¼Ç¼£¬Óö¨Î»·û(tab)°ÑÖµ·Ö¿ª£¬²¢ÇÒÒÔCREATE TABLEÓï¾äÖÐÁгöµÄÁдÎÐò¸ø³ö¡£¶ÔÓÚ¶ªÊ§µÄÖµ(ÀýÈçδ֪µÄÐԱ𣬻òÈÔÈ»»î×ŵĶ¯ÎïµÄËÀÍöÈÕÆÚ)£¬Äã¿ÉÒÔʹÓÃNULLÖµ¡£ÎªÁËÔÚÄãµÄÎı¾ÎļþÖбíʾÕâЩÄÚÈÝ£¬
ʹÓÃ\N£¨·´Ð±Ïߣ¬×ÖĸN£©¡£ÀýÈ磬WhistlerÄñµÄ¼Ç¼ӦΪ(ÕâÀïÖµÖ® ......
µ±×¢Éämysql¿âµÄÊäÈëµãµÄʱºò,ÎÒÃÇ¿ÉÒÔͨ¹ýversion()/user()/database()/password()µÈÄÚÖú¯ÊýÀ´µÃµ½mysqlµÄÏà¹ØÐÅÏ¢,ÆäʵÎÒÃÇÔÚ×¢ÉäµÄʱºò¿ÉÒÔÀûÓÃmysqlÄÚÖõıäÁ¿À´µÃµ½¸ü¶àµÄmysqlÐÅÏ¢
ÆäÖÐversion()¿ÉÒÔд³É@@versionÀ´°Ñversionµ±×ö±äÁ¿À´¶ÁÈ¡,ÕâÑùÒ»Ñù¿ÉÒԵõ½,ÆäËûµÄÄÚÖÃÊDz»¿ÉÒÔд³É±äÁ¿µÄÐÎʽ.
´ó¼Ò¶¼Ó¦¸ÃÓùýÀû ......
µÚÒ»ÕС¢mysql·þÎñµÄÆô¶¯ºÍÍ£Ö¹
net stop mysql
net start mysql
µÚ¶þÕС¢µÇ½mysql
Óï·¨ÈçÏ£º mysql -uÓû§Ãû -pÓû§ÃÜÂë
¼üÈëÃüÁîmysql -uroot -p£¬ »Ø³µºóÌáʾÄãÊäÈëÃÜÂ룬ÊäÈë12345£¬È»ºó»Ø³µ¼´¿É½øÈëµ½mysqlÖÐÁË£¬mysqlµÄÌáʾ·ûÊÇ£º
mysql>
×¢Ò⣬Èç¹ûÊÇÁ¬½Óµ½ÁíÍâµÄ»úÆ÷ÉÏ£¬ÔòÐèÒª¼ÓÈëÒ»¸ö²ÎÊý-h»úÆ÷IP
µ ......
£¨1£©ÔÚÉè¼ÆÊý¾Ý¿â×ֶεÄʱºò£¬°ÑÐèÒª»ñÈ¡ÊÖ»úºÅµÄ×Ö¶ÎÉèÖÃΪint(11)£¬ÔÒâÊÇҪȡ11λÊýµÄ£¬½á¹û·¢ÏÖËùÓеÄÊÖ»úºÅÂ룬¶¼±ä³ÉÁË2147483647
£¬¶Ùʱ¾õµÃºÜÆæ¹Ö£¬ÒÔΪÊdzÌÐòÓÐÎÊÌ⣬×îºó·¢¾õÊÇÊý¾Ý¿âÉè¼ÆµÄÎÊÌâ¡£ÒòΪÓзûºÅÕûÊýµÄ×î´óֵΪ
2147483647£¬ËùÒÔ×îºó¾ö¶¨°ÑÊý¾Ý¿âµÄ½á¹¹±ä»¯Ï£¬°Ñint(11)±äΪchar(11)²Å¸ã¶¨¡£
£¨2 ......
mysql Ã÷Ã÷ÒѾװºÃÁË£¬µ«ÊÇÎÞ·¨·ÃÎÊ¡£Á´½ÓµÄʱºò ×ÜÊÇ˵
Access Denied.
½â¾ö·½·¨£º
ÓÃmysqld --skip-grant-tableÆô¶¯mysql
È»ºóÔÚmysql¿âÖÐÖ´ÐÐÕâ¸ö
INSERT INTO user VALUES ('localhost', 'root', PASSWORD('some_pass'), 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y', 'Y', ......