- 1 min

MySQL ERROR 2003 报错记录

问题:

MySQL 远程连接报错

ERROR 2003 (HY000): Can't connect to MySQL server (111)

背景

1.服务器宕机前 MySQL 正常

2.本机登录 MySQL 正常

3.MySQL配置没动过,所以配置也正常

排查

1.查看配置文件

 [root@Topaz ~]# cat /etc/my.cnf
 port = 3306
 bind-address = 0.0.0.0
 #skip-networking
 

会导致远程连不上的几个参数都ok

2.在另一台机器上ping

 [root@web ~]# ping 10.0.0.129
 	PING 10.0.0.129 (10.0.0.129) 56(84) bytes of data.
 	64 bytes from 10.0.0.129: icmp_seq=1 ttl=64 time=4.14 ms
 

能ping通

3.telnet端口,oops连不上

 [root@web ~]# telnet 10.0.0.129 3306
 	telnet: connect to address 10.0.0.129: No route to host
 

4.iptables -L 检查防火墙

5.最后确定是防火墙的问题,该删的删

Topaz

Topaz

Always keep learning.

comments powered by Disqus
rss facebook twitter github youtube mail spotify instagram linkedin google pinterest medium vimeo