Linux_ERROR 1045 (28000): Access denied for user 'root'@'localhost'

时间:2022-03-01 20:37:52

MySQL生成了root用户的随机密码(如下截图所示),并将这个随机密码放置在/root/.mysql_secret中。并且强制在第一次登陆时修改root用户的密码。Mysql 5.6及以后版本出处于安全考虑,root密码不为空。

cat /root/.mysql_secret

Linux_ERROR 1045 (28000): Access denied for user 'root'@'localhost'

 

 Linux_ERROR 1045 (28000): Access denied for user 'root'@'localhost'

 

Linux_ERROR 1045 (28000): Access denied for user 'root'@'localhost'

 

Linux_ERROR 1045 (28000): Access denied for user 'root'@'localhost'