码迷,mamicode.com
首页 > 数据库 > 详细

MySQL出错:ERROR 1045 (28000)的解决方法

时间:2015-04-05 08:56:02      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:

MySQL突然不能用了,症状如下:

[root@bogon ok]# mysql
ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)
[root@bogon ok]# mysql
-uroot -p Enter password: ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)
[root@bogon ok]#
/etc/init.d/httpd start 正在启动 httpd:
[root@bogon ok]#
/etc/init.d/mysqld restart 停止 mysqld: [确定] 正在启动 mysqld: [确定]
[root@bogon ok]# mysql ERROR
1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO) [root@bogon ok]# mysql -uroot -p Enter password: ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)
解决方法:重改密码 [root@bogon ok]# /etc/init.d/mysqld stop 停止 mysqld: [确定]
[root@bogon ok]# mysqld_safe
--user=mysql --skip-grant-tables --skip-networking & [1] 10354 [root@bogon ok]# 150404 16:46:14 mysqld_safe Logging to ‘/var/log/mysqld.log‘. 150404 16:46:14 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql [root@bogon ok]# mysql -u root mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A 。。。。。。。 Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement. mysql>

[root@bogon ok]# mysql -u root -p
Enter password:

mysql>

问题解决。

 

MySQL出错:ERROR 1045 (28000)的解决方法

标签:

原文地址:http://www.cnblogs.com/chinas/p/4393555.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!