1. Open & Edit /etc/my.cnf
  2. Add skip-grant-tables under [mysqld]
  3. Restart Mysql
  4. You should be able to login to mysql now using the below command mysql -u root -p
  5. Run mysql> flush privileges;
  6. Set new password by ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword';
  7. Go back to /etc/my.cnf and remove/comment skip-grant-tables
  8. Restart Mysql
  9. Now you will be able to login with the new password mysql -u root -p

相关文章:

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