1,修改/etc/my.cnf添加添加skip-grant参数,重启mysql.

2,登录mysql  mysql -uroot

3, 更新user中root的密码  use mysql;   update user set password=password ('npasswd') where user='root'

4,将/etc/my.cnf 中的skip-grant取消掉,重启mysql,使用新密码登录查看是否OK。

相关文章:

  • 2021-11-28
  • 2021-11-28
  • 2019-01-07
  • 2021-11-28
  • 2021-11-28
  • 2021-11-28
猜你喜欢
  • 2021-08-28
  • 2021-09-22
  • 2021-09-21
  • 2021-06-11
  • 2021-11-26
  • 2022-01-30
  • 2021-07-22
相关资源
相似解决方案