一、防火墙开放3306端口

一般服务器放防火墙必须开启的,只需要开放具体的端口

1、防火墙开放3306端口

firewall-cmd --zone=public --add-port=3306/tcp --permanent

2、关闭防火墙

service iptables stop

3、开启防火墙

service iptables start

4、开机不自启防火墙

chkconfig --del iptables

5、重启防火墙

chkconfig iptables on
或者
firewall-cmd --reload

      重新关闭

chkconfig iptables off

6、查看防火墙状态

ervice iptables status  

7、查看已开启的端口

firewall-cmd --list-ports

版权声明:本文为yuezc原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/yuezc/p/13468704.html