想搭个服务器,但外面访问不到,是防火墙的原因,把端口设置一下就行。
1.在/etc/sysconfig/iptables里添加

Code
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
2.重启iptables

Code
[root@localhost ~]# /etc/init.d/iptables restart
3.看下状态

Code
[root@localhost ~]# /etc/init.d/iptables status