Centos防火墙导致MySQL不能远程访问
2020-04-12 本文已影响0人
不爱写代码的程序员
一、防火墙问题
1、查看防火墙状态:systemctl status firewalld,显示Active: inactive (dead)表示防火墙未开启

2、执行systemctl start firewalld开启防火墙

3、再次查看防火墙状态:systemctl status firewalld,显示Active: active (running)表示防火墙已开启;
注:可以通过systemctl stop firewalld关闭防火墙

4、开放3306端口:
firewall-cmd --permanent --zone=public --add-port=3306/tcp

firewall-cmd --add-port=3306/udp --permanent

5、重启防火墙:systemctl restart firewalld.service
6、查看防火墙开放的端口:firewall-cmd --list-ports
