摘要: 提示:ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'。前两天也出现过这个问题,网上找了一个比较流行的方法(见方法一),搞定了。今天又用这个试了试,却搞不定,在网上找了半天,终于发现是因为mysql数据库的user表里,存在用户名为空的账户即匿名账户,导致登录的时候是虽然用的是root,但实际是匿名登录的,通过错误提示里的''@'localhost'可以看出来,于是解决办法见方法二。方法一:1.关闭mysql 阅读全文
posted @ 2012-07-17 14:15 VipSoft 阅读(351) 评论(0) 推荐(0) 编辑
摘要: 解决方法:# /etc/init.d/mysql stop# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &# mysql -u root mysqlmysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';mysql> FLUSH PRIVILEGES;mysql> quit# /etc/init.d/mysqld restart# mysql -uroot -pE 阅读全文
posted @ 2012-07-17 12:30 VipSoft 阅读(501) 评论(0) 推荐(0) 编辑