ºìÁªLinuxÃÅ»§
Linux°ïÖú

ÈçºÎΪÓû§ÉèÖÃÃÜÂë(MYSQL)

·¢²¼Ê±¼ä:2006-08-24 12:42:20À´Ô´:ºìÁª×÷Õß:bear10214
µ±³õ´ÎÔÚ»úÆ÷ÉÏ°²×°ÍêMysqlʱ,Äã¿ÉÒÔÄäÃû½øÐзÃÎÊÊý¾Ý¿â»òÕßÒÔ²»´ø¿ÚÁîµÄrootÉí·Ý½øÈëÊý¾Ý¿â.ÁíÍâÈç¹ûÄãÊÇÒ»¸ö¹ÜÀíÔ±,Ä㻹Ҫ½øÐÐһЩÓû§µÄ½¨Á¢¼°ÊÚȨ,ÕâÓÖÉæ¼°µ½ÉèÖÃÃÜÂëµÄÎÊÌâ.ÏÂÃæÎÒÃǾÍÌÖÂÛÒ»ÏÂÈçºÎÉèÖÃÃÜÂë:
Ê×ÏÈÎÒÃÇÓ¦¸ÃÖªµÀMysqlÊý¾Ý¿âÖеĿÚÁî´æ´¢±ØÐëÓÃpassword()º¯Êý¼ÓÃÜËü.ÒòΪÔÚuser±íÖÐÊÇÒÔ¼ÓÃÜÐÎʽ´æ´¢¿ÚÁî,¶ø²»ÊÇ×÷Ϊ´¿Îı¾.Èç¹ûÄãûÓмÓÃÜ,Ö±½ÓÔÚÊý¾Ý¿âÖÐÖ´ÐÐÒÔÏÂÓï¾ä:
use mysql
insert into user (host,user,password) values('%','user_name','your password');
flush privileges;
ÏàÐŽá¹û²»»áÈÃÄãÂúÒâ.ÒòΪ·þÎñÆ÷±È½ÏµÄÊǼÓÃܵÄÖµ,ËùÒÔ·þÎñÆ÷Á¬½ÓÒ»¶¨Ê§°Ü.ÕâÀïÐèҪ˵Ã÷µÄÊÇflush privileges;ÕâÌõÃüÁîÆðµ½ÁËÖØмÓÔØÊÚȨ±í.ÄãÒ²¿ÉÒÔÔÚshellÏÂÖ±½ÓÓÃmysqladmin -u root reload»òÕßmysqladmin -u root flush-privilegesÀ´ÊµÏÖÖØÔØÊÚȨ±í.
ÔÚMysql»·¾³ÏÂ,Äã¿ÉÒÔʹÓÃÒÔÏÂÓï¾ä½øÐÐÉèÖÃÃÜÂë:
1.insert into user(host,user,password) values('%','user_name',password("your password");
2.set password for user_name = password("your password")
ÒÔÉÏÁ½ÖÖ·½·¨¶¼±ØÐë½øÐÐÖØÔØÊÚȨ±í.
3.µ±È»ÄãÒ²¿ÉÒÔÔÚ´´½¨Ò»¸öÓû§Ê±Ö±½ÓÉèÖÃÃÜÂë,grantÓï¾ä½«ÎªÄã×Ô¶¯¼ÓÃÜ¿ÚÁî.
Èç
grant all on *.* to user_name@% identified by "your password";
ÁíÍâÄãÒ²¿ÉÒÔÔÚshell»·¾³ÏÂÓÃmysqladmin³ÌÐòÀ´ÉèÖÃÃÜÂë
Èç
mysqladmin -u root password "your password"
¿ìµãÈ¥ÊÔÒ»ÏÂ,ûÎÊÌâ°É!
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ