mysql的Root密码忘记,如何修改

修改/etc/my.cnf

在【mysqld】下增加:

# add for free password

  skip-grant-tables

重启mysql

Service mysqld restart

Mysql进入

mysql> update mysql.user SET authentication_string=PASSWORD('mysql') where USER='root';

mysql>flush privieges;

mysql>exit

修改/etc/my.cnf

去掉增加的行,重启mysql

猜你喜欢

转载自www.cnblogs.com/zhxiaoxiao/p/9767455.html