且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法连接到远程MySQL Server

更新时间:2023-01-30 22:40:46

要检查的内容:

  1. MySQL正在使用公共IP进行监听(听起来像您所做的一样)
  2. MySQL正在标准端口上监听/您正在连接正在监听的端口.
  3. 远程计算机上是否运行防火墙? (它们通常是发行版的标准包装).防火墙是否配置为允许连接到该端口?
  4. 如果远程计算机位于另一个网络中,则连接和终端计算机之间是否正在进行网络地址转换(NAT)-如果是,则将其配置为允许MySQL端口通过.
  5. my.cnf文件是否配置为允许来自localhost 127.0.0.1 IP以外的任何其他地址的连接-尽管您更有可能获得访问被拒绝的响应,而不是无法连接.
  1. MySQL is listening on public IP (sounds like you've done)
  2. MySQL is listening on standard port / you're connecting the same port it's listening to.
  3. Is there a firewall running on the remote machine? (They usually are packaged standard in distros) Is the firewall configured to allow connections to that port?
  4. If the remote machine is within another network, is there network address translation (NAT) going on between your connection and the end machine - if so, is it configured to allow the MySQL port through.
  5. Is the my.cnf file configured to allow connections from anything other than localhost 127.0.0.1 IPs - although you'd more likely get a access denied response, than a cannot connect.