远程连接MySQL错误:Can't connect to MySQL server (10060)

Posted Mitsuis

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了远程连接MySQL错误:Can't connect to MySQL server (10060)相关的知识,希望对你有一定的参考价值。

一开始以为是ip权限的问题,捣鼓了很久,后来找了好久才知道需要开放防火墙

感谢:https://blog.csdn.net/testcs_dn/article/details/51406712

开放防火墙端口
添加需要监听的端口
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

保存设置
/etc/init.d/iptables save

查看状态
/etc/init.d/iptables status

临时关闭防火墙服务
service iptables stop

开启防火墙服务
service iptables start

开机不再启动防火墙服务
chkconfig iptables off

以上是关于远程连接MySQL错误:Can't connect to MySQL server (10060)的主要内容,如果未能解决你的问题,请参考以下文章