问题现象:输入mysql,提示:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

问题分析:执行apt-get update后root密码可能被覆盖了
解决步骤:
1、输入mysql密码进入mysqll[/code]
[email protected]~# mysql -uroot -pl
Enter password:

2、进入mysql库
mysql> use mysqll

3、查看user表,发现有两处密码没有清空。
mysql> select * from user;l

清空主机名localhost和127.0.0.1对应的密码
mysql> update user set Password = '' where Host =  'localhost' or Host = '127.0.0.1';l

4、查看是否有需要指定的密码的一行
mysql> select * from user

如果没有则执行以下语句:
mysql> insert into user(Host,User,Password) values('%','root',PASSWORD("XXXXXXXXXXXXX"));l

5、退出mysql
mysql> quit

6、重启mysql
[email protected]:~# /etc/init.d/mysql restartl

7、输入mysql,试试效果。
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 不区分大小写