报错:MySQL Access denied for user 'root'@'localhost' (using password: YES)

报错背景

MySQL重新初始化后,

进去MySQL的时候被拒绝。

报错现象

报错原因

报错解决

编辑配置文件
# vim /etc/my.cnf
添加以下内容
skip-grant-tables
重启mysql
# systemctl restart mysqld

重启之后即可

原文地址:https://www.cnblogs.com/chuijingjing/p/13984041.html