错误-linux centOS7-MySQL登录时出现Access denied for user 'root'@'localhost' (using password: YES) 拒绝访问


1.错误提示

2.修改MySql配置文件my.cnf,新增skip-grant-tables

 

 添加skip-grant-tables,这样mysql可以免密登录。

 

3.重启服务
重启mysqld服务

4.再次连接MySql,重置密码
任意密码就可以进入了

 

 切换到mysql数据库

 

 

 重置密码(为 root )

update user set authentication_string=password('root') where user='root';

5. 修改配置文件my.cnf,删除skip-grant-tables,重启,再登录

删除skip-grant-tables

重启服务

再次使用新密码登录即可


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM