美文网首页
2019-09-29 MySQL忘记密码解决方案

2019-09-29 MySQL忘记密码解决方案

作者: 柒李香 | 来源:发表于2019-09-29 07:54 被阅读0次
时光流转

1、管理员身份打开命令行

net stop mysql

2、跳过用户验证

  mysqld --skip-grant-tables 

3、管理员身份打开新窗口,输入

mysql
image.png

4、进入mysql数据库

use mysql;

5、重新设置密码

update user set password=password('123456') where user='root' and host='localhost';

如果出现以下错误,则将命令改为

update user set authentication_string=password('123456') where user='root' and host='localhost';

修改后exit退出

6、启动mysql服务并登录

net start mysql
mysql -uroot -p123456

修改成功

相关文章

网友评论

      本文标题:2019-09-29 MySQL忘记密码解决方案

      本文链接:https://www.haomeiwen.com/subject/zgxbyctx.html