【问题标题】:Access Denied denied for user 'root'@'localhost' (using password: yes) after Ubuntu Upgrade to 20.04Ubuntu 升级到 20.04 后,用户“root”@“localhost”的访问被拒绝(使用密码:是)
【发布时间】:2020-07-01 07:27:18
【问题描述】:

将 Ubuntu 从 18.04 升级到 20.04 后,我无法访问我们的系统。我收到Access Denied denied for user 'root'@'localhost' (using password: yes)。我尝试使用mysql -u root -p,输入密码后我可以连接,但使用mysql -u root -h 127.0.0.1 时出现错误access denied

补充一下,数据库中有3个root用户,如下:

+------------------+-----------------+
| user             | host            |
+------------------+-----------------+
| remote           | %               |
| root             | 127.0.0.1       |
| root             | ::1             |
| debian-sys-maint | localhost       |
| mysql.session    | localhost       |
| mysql.sys        | localhost       |
| phpmyadmin       | localhost       |
| remote           | localhost       |
| root             | localhost       |
+------------------+-----------------+

【问题讨论】:

    标签: mysql ubuntu


    【解决方案1】:
    GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'YOURPWD';
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-11
      • 2013-11-03
      • 2014-09-10
      • 2012-08-08
      • 2013-05-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多