您的位置:首页 > 其它

ERROR 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: NO)

2012-05-11 14:16 441 查看
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!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐