1.开启跳过权限验证

vi /etc/my.cnf
[mysqld]
skip-grant-tables

/etc/init.d/mysqld restart

2.重置密码

use mysql;
update user set authentication_string=password('123456') where user='root' and host='localhost';
flush privileges;

/etc/init.d/mysqld restart

vi /etc/my.cnf
[mysqld]
skip-grant-tables    #delete

/etc/init.d/mysqld restart

ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';

相关文章:

  • 2021-12-10
  • 2021-06-03
  • 2022-12-23
  • 2021-06-18
  • 2022-01-13
  • 2022-12-23
  • 2021-07-24
  • 2021-12-03
猜你喜欢
  • 2021-12-23
  • 2021-11-16
  • 2022-02-12
  • 2021-12-29
  • 2021-09-26
  • 2021-11-17
  • 2022-01-19
相关资源
相似解决方案