1.vim /etc/my.cnf
skip-grant-tables  #取消此行的注释

2.重启mysql
systemctl restart mysqld

3.mysql 登陆mysql
mysql> use mysql;
mysql> UPDATE user SET Password = password ( '123456' ) WHERE User = 'root' ;
mysql> flush privileges ;
mysql> quit

4.恢复配置文件my.cnf
vim /etc/my.cnf
[mysqld]
skip-grant-tables ##去掉此行,继续校验权限表,

5.重启mysql
systemctl restart mysqld

相关文章:

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