mysql重置/找回root用户密码 收藏
2010年06月25日


step1:停止mysql服务

step2:启动 mysqld服务,加上--skip-grant-tables选项

step3:用 root用户连接mysql(这时不用输入密码即可进入)

step4:为 root用户设置新密码

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> update user set password=PASSWORD("hello")where user="root";
Query OK, 3 rows affected (0.03 sec)
Rows matched: 3 Changed: 3 Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> quit

 

本文永久链接: http://www.zzxj.net/blog/fxs_2008/archive/2010/06/25/172.html

发表于 @ 2010年06月25日 |评论(loading... )|收藏

发表评论 姓  名: