首页 > 代码库 > linux下telnet mysql的3306断口,提示Can't connect to MySQL server on localhost (110)

linux下telnet mysql的3306断口,提示Can't connect to MySQL server on localhost (110)

新购买的阿里云ECS服务器,食用lnmp环境,安装完毕后,telnet localhost 3306提示Can‘t connect to MySQL server on localhost (110);

首先通过命令行查看mysql是否启动

如果mysql已经正常启动,查看端口3306是否分配给msyql

通过查看服务器上3306是正常分配给msyql的

问题就应该出现在防火墙上了,通过

vi /etc/sysconfig/iptables

加入一行

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

重启防火墙

/sbin/service iptables restart

 

linux下telnet mysql的3306断口,提示Can't connect to MySQL server on localhost (110)