1、my.ini文件中的[mysqld]下面一行添加 skip_grant_tables
2、update user set host = 'localhost' where user = 'root'
3、UPDATE user SET Password=PASSWORD('xiaoli') where USER='root'
4、将my.ini中添加的 skip_grant_tables 删除
2、update user set host = 'localhost' where user = 'root'
3、UPDATE user SET Password=PASSWORD('xiaoli') where USER='root'
4、将my.ini中添加的 skip_grant_tables 删除
本文介绍了一种在忘记MySQL root密码后重新设置的方法。通过在my.ini文件中添加配置跳过权限表,更新root用户的密码,并最后移除临时配置。

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



