NO Route to Host 连接mysql数据库

显然是请求被服务器的防火墙给拦截了

1,vi /etc/sysconfig/iptables  

2,在倒数第三行以前添加

-A INPUT -p tcp -m state –state NEW -m tcp –dport 3306 -j ACCEPT  

3,重启防火墙

service iptables restart

4,service iptables status