1.防火墙开启3306端口
firewall-cmd --add-port=3306/tcp
2.防火墙生效
firewall-cmd --runtime-to-permanent
3.其他命令(停止和启动防火墙)
systemctl stop firewalld
systemctl start firewalld
4.检查防火墙状态
firewall-cmd --check-config
5.查看防火墙开启端口
firewall-cmd --list-ports
6关闭防火墙端口
firewall-cmd --remove-port=port-number/port-type