标签:
ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)
一般出现这种错误不是密码没设置,就是密码错误(可能也有其他的原因)
依次执行下面的命令:
/etc/init.d/mysql stop (service mysqld stop )
/usr/bin/mysqld_safe --skip-grant-tables
另外开个SSH连接
[root@localhost ~]# mysql
mysql>use mysql
mysql>update user set password=password("123456") where user="root";
mysql>flush privileges;
mysql>exit
pkill -KILL -t pts/0 可将pts为0的**用户(之前运行mysqld_safe的用户窗口)强制踢出
正常启动 MySQL:/etc/init.d/mysql start (service mysqld start)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
标签:
原文地址:http://www.cnblogs.com/asif/p/4381597.html