第一步:修改 /etc/mysql/my.cnf。

在【mysql】下添加skip-grant-table;重启。

第二步:通过mysql命令登陆;

  flush privileges;

  use mysql;

  alter user 'root'@'localhost' identified with mysql_native_password by 'Newpassword@123';(不确定的要求:新密码需要字母大小写+特殊字符)

  flush privileges;

  再把skip-grant-table去掉;重启。

最后一步:msyql -uroot -p登陆(不能直接 -pNewpassword@123)

 

相关文章:

  • 2021-11-23
  • 2021-12-21
  • 2021-05-06
  • 2021-08-11
  • 2021-10-04
猜你喜欢
  • 2021-09-11
  • 2021-07-03
  • 2021-06-22
相关资源
相似解决方案