Ubuntu 升级到 20.04 后,用户"root"@"localhost"(使用密码:是)的访问被拒绝



将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 个根用户,如下所示:

+------------------+-----------------+
| 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       |
+------------------+-----------------+
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'YOURPWD';

相关内容

  • 没有找到相关文章

最新更新