1. 全过程如下:
[root@localhost ~]# netstat -ntlp // 检查端口是否在用
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 10066/nginx: master
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 9019/sshd
tcp6 0 0 :::3306 :::* LISTEN 9849/mysqld
tcp6 0 0 :::22 :::* LISTEN 9019/sshd
[root@localhost ~]# firewall-cmd --zone=public --add-port=3306/tcp --permanent // 发现防火墙未运行,3306开启失败
FirewallD is not running
[root@localhost ~]# firewall-cmd --reload
FirewallD is not running
[root@localhost ~]# systemctl status firewalld // 查看防火墙是否在运行,但是防火墙dead了
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/