第1步:skip-grant-tables

保证mysql关闭,在目录mysql/bin/ 的配置文件 my.ini 的 [mysqld] 下 skip-grant-tables

Mysql数据库忘记root密码

 

第2步:启动mysql  (这里是xampp的mysql)

Mysql数据库忘记root密码

 

第3步:管理员权限 打开cmd命令行  mysql -u root -p 

进入目录mysql/bin/ ——>  mysql -u root -p  ——>   回车

Mysql数据库忘记root密码

 

第4步:update user set password=password("123456") where user='root';

use mysql  ——>  update user set password=password("123") where user='root';

Mysql数据库忘记root密码

 

重置root密码成功!

 

相关文章:

  • 2022-02-28
  • 2021-07-12
猜你喜欢
  • 2021-11-28
  • 2021-11-28
  • 2021-10-27
  • 2021-11-28
  • 2021-10-26
  • 2021-09-18
  • 2022-03-03
相关资源
相似解决方案