请注意。操作系统为ubuntu 14。*
我正在为我的MYSQL服务器上的连接而头疼。我尝试通过我的公网ip连接到内部的MYSQL服务器。但是我无法连接。当我连接到本地主机和外部连接时,我可以连接。
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1我注释掉了bind-adress,这应该会将地址绑定到0.0.0.0。我还尝试将bind-adres设置为0.0.0.0。这也不起作用。
我的hosts文件设置如下:
127.0.0.1 MY-IP当我在端口80上telnet到我的公网ip时,没有问题。
telnet MY-IP 80我得到了:
Trying MY-IP...
Connected to MY-IP.
Escape character is '^]'.但当我在端口3306上尝试时,它仍然在运行:
Trying MY-IP...我还将所有正确的权限授予了我的MYSQL用户。我有可能将外在和内在联系起来。但是我不能用我的公网ip对接内部。
此外,我还尝试使用netstat找到解决方案。
netstat -tln 给我
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN编辑:只是禁用了UFW。它还是不能工作。
ufw status
Status: inactiveEDIT2:有没有可能mysql忽略了/etc/hosts文件?
有没有人能进一步帮我想出一些好点子来解决问题。
https://stackoverflow.com/questions/41441413
复制相似问题