我已经尝试过远程远程连接到我的mysql数据库,但是我收到连接被拒绝错误。我已将bind-address更改为0.0.0.0,我已经运行了ufw,输出是
sudo ufw status verbose
sudo: unable to resolve host iot
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
To Action From
-- ------ ----
3306 ALLOW IN Anywhere
3306 ALLOW IN 0.0.0.0
22 ALLOW IN Anywhere
80 ALLOW IN Anywhere
3306/tcp ALLOW IN Anywhere
3306/tcp (MySQL) ALLOW IN Anywhere
3306/tcp ALLOW IN 0.0.0.0
3306 (v6) ALLOW IN Anywhere (v6)
22 (v6) ALLOW IN Anywhere (v6)
80 (v6) ALLOW IN Anywhere (v6)
3306/tcp (v6) ALLOW IN Anywhere (v6)
3306/tcp (MySQL (v6)) ALLOW IN Anywhere (v6)
3306/tcp ALLOW OUT Anywhere
3306/tcp (v6) ALLOW OUT Anywhere (v6)
我已经允许我的ip被授予特权而且没有任何内容:
mysql> select host, user from mysql.user;
+----------------+-------+
| host | user |
+----------------+-------+
| % | admir |
| % | root |
| 127.0.0.1 | admir |
| X.X.X.X | admir |
| X.X.X.X | root |
| localhost | admir |
| localhost | root |
+----------------+-------+
有人可以告诉我,我有什么遗失的吗? 我的IP地址似乎不是广播的地址(只有localhost),因为:
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 3199/mysqld
我该如何解决这个问题?
答案 0 :(得分:0)
您是否尝试完全注释掉绑定地址行并重新启动MySQL?根据该netstat行,您只是在侦听本地主机。
另外,在重新启动mysqld之前,确保你的MySQL进程真的死了,我已经看过" ghost"过去运行的MySQL实例,它不允许服务正确绑定并侦听远程连接。