Access denied for user ‘root‘@‘localhost‘ (using password: YES)——宝塔面板MySQL密码错误问题解决

1. bug

宝塔面板终端:通过mysql -u root -p 命令输入密码后,报错:ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)

在这里插入图片描述

2. 解决方法

2.1 关闭数据库

service mysqld stop

在这里插入图片描述

2.2 设置MySQL在首页显示(方便操作)

在这里插入图片描述

2.3 修改MySQL配置

[mysqld]末端添加:skip-grant-tables

在这里插入图片描述在这里插入图片描述

2.4 重载配置并启动

在这里插入图片描述

2.5 完工,试试

mysql -uroot

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_45844767/article/details/127920945