MySQL连接尝试超时使用本地IP

时间:2016-04-04 05:38:12

标签: mysql portforwarding

我正在尝试通过本地网络连接到MySQL(使用--host = 192.168.1.xxx),但是当我尝试初始化客户端时,我只是在MySQL错误出现之前大约1分钟没有响应具有通用2003错误。我的解释是,这意味着连接尝试永远不会在正确的位置结束(因此TCP连接只是超时)。

运行MySQL Server的计算机是Windows 10上的普通笔记本电脑(不运行Windows Server或类似的东西)。我已经离开并检查了防火墙规则,并且明确启用了端口3306以用于传入连接。运行“netstat -a -n”显示服务器计算机上的端口3306具有状态LISTENING。我已经尝试指定端口3306,以及从​​端口3306到路由器上的端口3306的端口转发/端口触发,但没有解决此问题。我该如何让这个连接起作用?作为参考,我对客户端使用以下命令:

mysql --host=192.168.1.34 --port=3306 --user='username' --password='password'

1 个答案:

答案 0 :(得分:0)

此问题属于以下情况:

  1. Client and Server, either or both of them are not in network.
  2. Server is not running.
  3. Server is running but not listening on port, client is trying to connect.
  4. Firewall is not permitted for host-port combination.
  5. Host port combination is incorrect.

在上面的客户端意味着你的本地系统和服务器意味着MySQL运行机器的地方。To solve the problem:

相关问题