1.跳过MySQL的密码认证过程
修改my.ini,在[mysqld]文本段下添加:skip-grant-tables
2.重启MySQL
3.cmd进入MySQL的bin下,使用mysql命令进入mysql

4.(1)mysql> use mysql;
(2)mysql> update user set password=password("你的新密码") where user="root";//修改
(3)mysql> flush privileges;
(4)mysql> quit; //退出
注:5.7之后的版本password改为authentication_string
update user set authentication_string=password("你的新密码") where user="root";
本文介绍了一种在忘记MySQL密码后重置的方法。通过修改my.ini文件的配置跳过密码认证,然后更新root用户的密码。
376

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



