## 开放端口
```
[centos@localhost root]$ sudo firewall-cmd --zone=public --add-port=3306/tcp --permanent
[centos@localhost root]$ sudo firewall-cmd --zone=public --list-ports
[centos@localhost root]$ sudo firewall-cmd --reload
success
[centos@localhost root]$ sudo firewall-cmd --zone=public --list-ports
3306/tcp
```
## 关闭和开启
```
sudo systemctl start firewalld
sudo systemctl stop firewalld
sudo systemctl status firewalld
sudo systemctl disable firewalld
sudo systemctl enable firewalld
```