http://www.rajatswarup.com/blog/2010/07/24/error-1045-28000-access-denied-for-user-rootlocalhost-using-password-no/
If this is the error you are getting then one of the solutions is to reset your root password on the MySQL database server.
$ pkill mysql
$ sudo mysqld --skip-grant-privileges
$ mysql
At this point you get the mysql command shell. You will need to update the root password and flush the table when you reset the password.
mysql> set UPDATE mysql.user SET Password=PASSWORD('YOUR_NEW_PASSWORD') WHERE User='root';
mysql> FLUSH PRIVILEGES;
Now that you’ve flushed your passwords, just restart your mysql daemon.
$ sudo pkill mysqld
$ sudo /etc/init.d/mysqld start
$ mysql -u root -p
Enter Password: YOUR_NEW_PASSWORD
mysql>
You should be all set now!

本文介绍了一种解决MySQL root用户密码被拒绝访问的方法。通过停止MySQL服务,使用--skip-grant-tables参数启动来绕过权限检查,然后更新root用户的密码,并刷新权限表。
43万+

被折叠的 条评论
为什么被折叠?



