我已经在远程Ubuntu计算机上安装了MySQL服务器。通过以下方式root在mysql.user表中定义用户:
mysql> SELECT host, user, password FROM user WHERE user = 'root';
+------------------+------+-------------------------------------------+
| host | user | password |
+------------------+------+-------------------------------------------+
| localhost | root | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| ip-10-48-110-188 | root | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| 127.0.0.1 | root | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
| ::1 | root | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
+------------------+------+-------------------------------------------+
我可以root使用标准mysql客户端从同一远程计算机命令行界面与用户访问。现在,我想
允许来自Internet上每台主机的root用户访问权限 ,因此我尝试添加以下行(这与上一转储的第一行完全相同,但该host列除外):
mysql> SELECT host, user, password FROM user WHERE host = '%';
+------------------+------+-------------------------------------------+
| host | user | password |
+------------------+------+-------------------------------------------+
| % | root | *xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
+------------------+------+-------------------------------------------+
但是我个人PC上的客户端继续告诉我(我掩盖了服务器IP):
SQL错误(2003):无法连接到“ 46.xxx”上的MySQL服务器(10061)
我不知道是身份验证错误还是网络错误。在服务器防火墙上,我为端口 3306 / TCP 启用了 0.0.0.0/0 ,这对我来说是可以的…