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去掉之前的配置项,重启即可登录