Problem:
(HY000/2003): Can’t connect to MySQL server (99)
Solution:
Step 1. vim /etc/sysctl.conf
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_tw_recycle=1
net.ipv4.tcp_fin_timeout=30
net.ipv4.tcp_max_syn_backlog=8192
Step 2. Apple the new settings
sysctl -p
Other commands:
Check the current setting:
cat /proc/sys/net/ipv4/tcp_tw_recycle
References:
https://forums.aws.amazon.com/thread.jspa?threadID=56244
http://my.oschina.net/sansom/blog/148493
http://www.111cn.net/phper/php-database/52620.htm
http://liugehao.github.io/sqlstatehy000-2003-cant-connect-to-mysql-server-on-servername-99.html
http://zyan.cc/post/338/