douhu8851 2017-06-21 14:02
浏览 394

无法连接到MySQL:(1045)用户'root'@'localhost'拒绝访问(使用密码:YES)[复制]

This question already has an answer here:

I am deploying a Wordpress enviroment, and there seems to happen a weird situation.

I did some tweakings and set a new root password like this

mysql -u root –p
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'MyNewPass';
service mysql restart
ufw allow 3306

then I changed the settings of bind from /etc/mysql/mysql.conf.d to from 127.0.0.1 to 0.0.0.0 so that I can access it via mySQL Workbench. Which was successful as I now am able to enter the DB from outside sources.

Once I changed the password, I altered the wp-config.php file and set the new credentials.

enter image description here

However, now, I am getting errors inside the WordPress whenever I log on, I see the following errors, despite the fact that the website runs without any issues and the articles appear.

 Failed to connect to MySQL: (1045) Access denied for user 'root'@'localhost' (using password: YES)

Below is an image of the error I am getting

enter image description here

I tried manny different scenarios on SO, and I am really sorry in advance for posting this again, but non of the solutions provided work.

Any ideas on resolving this?

And while we are at it,

  1. what does (using password: YES) or (using password: NO) mean ?
  2. What is the difference between root@localhost and root@127.0.0.1
</div>
  • 写回答

3条回答 默认 最新

  • douqiu0796 2017-06-21 14:05
    关注

    using password: YES shows that you entered mysql password.

    127.0.0.1 and localhost are same

    评论

报告相同问题?

悬赏问题

  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 MATLAB中streamslice问题
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序