当前位置:Gxlcms > 数据库问题 > 新装mysql数据库登陆不上去(账号密码正确)

新装mysql数据库登陆不上去(账号密码正确)

时间:2021-07-01 10:21:17 帮助过:5人阅读

  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

新装mysql数据库登陆不上去(账号密码正确)

标签:grant   ges   密码   man   tar   sql数据库   str   use   move   

人气教程排行