linux 开放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
posted @ 2022-06-07 21:00  薛大坑  阅读(6996)  评论(0编辑  收藏  举报