1.管理员打开cmd窗口

2.输入net stop mysql,停止mysql服务

3.开启跳过验证密码的mysql服务

用记事本打开
mysql8.0.19忘记密码

输入skip-grant-tables ,保存
mysql8.0.19忘记密码

4.管理员打开新的cmd窗口,输入 net start mysql,启动mysql服务

5.输入 mysql -u root -p ,密码直接回车键跳过
mysql8.0.19忘记密码

6.将密码置空


use mysql
update user set authentication_string='' where user=‘root';
exit

mysql8.0.19忘记密码

  1. 关闭步骤四的窗口

8.注释my.ini 的skip-grant-tables,保存
mysql8.0.19忘记密码

9.管理员模式打开一个新的窗口,输入mysql -uroot -p

10.修改密码


ALTER USER ‘root'@‘localhost' IDENTIFIED WITH BY ‘123456';
flush privileges

mysql8.0.19忘记密码

11.用Navicat链接
mysql8.0.19忘记密码

相关文章:

  • 2021-12-27
  • 2021-09-16
  • 2021-06-10
  • 2021-05-07
  • 2021-05-25
  • 2021-09-21
猜你喜欢
  • 2022-12-23
  • 2021-10-25
  • 2021-12-04
  • 2021-12-05
  • 2021-12-15
  • 2021-11-18
  • 2021-12-27
相关资源
相似解决方案