修改 vim /etc/my.cnf 加上一句:skip-grant-tables
1.保存并且退出。重新启动mysqld
service mysqld restart
2.登录并修改MySQL的root密码
mysql
use mysql;
sql: update user set authentication_string=password(‘new password’) where user=’root;
3.执行 flush privileges;
4.退出mysql。
5.删除 skip-grant-tables
6.重启mysql
本文介绍了一种在忘记MySQL root密码的情况下,通过修改配置文件跳过权限表验证,然后更新root用户密码的方法。
1396

被折叠的 条评论
为什么被折叠?



