1.防火墙开放3306端口
systemctl status firewalld//查看防火墙状态
service firewalld start//开启防火墙
service firewalld stop//关闭防火墙
firewall-cmd --query-port=8080/tcp//查询端口是否开放
firewall-cmd --permanent --add-port=80/tcp//开放80端口
firewall-cmd --permanent --remove-port=8080/tcp//移除8080端口
service firewalld restart//配置完成后重启防火墙
2.数据库中配置允许任何IP访问
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
flush privileges;//配置完成后刷新