mysql 8.0.12版本 忘记密码

1.mysqld --console --skip-grant-tables --shared-memory

2.另一个控制台 mysq

3.use mysql;

4.select user,host,authentication_string from user ;

5.update user set authentication_string='' where user='root' ;

6.无密码登陆,再修改想要的密码  (不直接在上一步修改密码是因为,mysql会有有一个加密。直接设为空就好。在下一步没有编码的步骤进行修改密码。)

ALTER user 'root'@'localhost' IDENTIFIED BY '111111';

6.成功

posted @ 2019-07-16 09:56  _Meditation  阅读(174)  评论(0编辑  收藏  举报