MySQL 登陆错误:access denied for user root @localhost

来源:互联网 发布:福汇软件下载 编辑:程序博客网 时间:2024/06/08 16:56

MySQL5.7登录提示:access denied for user root @localhost

个人解决方法:

编辑配置项:

vim /etc/my.cnf

跳过身份验证:

skip-grant-tables

重启服务:

systemctl restart mysqld

进入MySQL:

mysql -uroot -p

use mysql;

更新密码

update user set authentication_string = password("*******") where user="root";
exit
去掉之前的配置项,重启即可登录



阅读全文
0 0
原创粉丝点击