MySQL ERROR 2003 Troubleshooting
Problem:
MySQL connection raise an error
ERROR 2003 (HY000): Can't connect to MySQL server (111)
Background
1.MySQL was working normal before the server went down
2.Local environment can connect to MySQL normally
3.The MySQL configuration has not been modified, so the configuration is also normal
Troubleshooting steps
1.Check configuration file
[root@Topaz ~]# cat /etc/my.cnf
port = 3306
bind-address = 0.0.0.0
#skip-networking
Several parameters that will cause the remote connection to be failed are all look good
2.Ping from another server
[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
Can ping successfully
3.telnet port,oops got an error
[root@web ~]# telnet 10.0.0.129 3306
telnet: connect to address 10.0.0.129: No route to host
4.iptables -L check the firewall
5.Finally, it is determined that it is a problem with the firewall. Delete the routing rule that caused the error.