这篇文章主要为大家展示了“Linux中连接mysql报错:Access denied for user ‘root’@‘localhost’(using password: YES)怎么办”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Linux中连接MysqL报错:Access denied for user ‘root’@‘localhost’(using password: YES)怎么办”这篇文章吧。
前言
最近在linux连接MysqL /usr/local/MysqL/bin/MysqL -uroot -p
输入密码出现Access denied for user 'root'@'localhost'(using password: YES)
错误。下面话不多说了,来一起看看详细的解决方法吧
解决办法:
1.先停止MysqL 服务
service MysqLd stop
2.进入MysqL安装目录bin/ 使用safe模式,进行重启:
./MysqLd_safe --skip-grant-tables
MysqL -u root use MysqL update user set password=PASSWORD("你的密码") where User = 'root';
service MysqLd restart 重启
/usr/local/MysqL/bin/MysqL -uroot -p
然后输入刚才重置的密码
以上是“Linux中连接MysqL报错:Access denied for user ‘root’@‘localhost’(using password: YES)怎么办”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注编程之家行业资讯频道!