Linux连接Mysql输入正确密码的时候报错误:
Access denied for user’root’@’localhost'(using password: YES)
如何解决:
-
先停掉服务: service mysqld stop
-
然后使用安全模式登录跳过密码验证:
mysqld_safe –user=mysql –skip-grant-tables –skip-networking&
-
登录: mysql -uroot mysql
4.修改密码 :
mysql > update user set authentication_string = password(‘******’) where user = ‘root’ and Host = ‘localhost’
在password(‘’)在引号里面输入要修改的密码
5.刷新权限: mysql > flush privileges
然后在尝试连接一下数据库: mysql /usr/local/mysql/bin/mysql -uroot -p