将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';