Linux iptables 开放Mysql端口

Standard

修改防火墙配置文件:
vi /etc/sysconfig/iptables
增加下面一行:
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT
如果想开通21等端口,只需要将3306换成21等要开放的端口就可以了。
配置后,重新启动iptable
service iptables restart
这时就可以从外网访问Mysql了。

One thought on “Linux iptables 开放Mysql端口

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.