1.1.1. 关闭数据库服务的防火墙
systemctl start firewalld.service
systemctl status firewalld.service
systemctl stop firewalld.service
systemctl enable firewalld.service
systemctl disable firewalld.service
1.1.1. 或者不关防火墙,而是,开发3306端口
查看开放的端口号
firewall-cmd --list-all
设置开放的端口号
firewall-cmd --add-service=http --permanent
firewall-cmd --add-port=80/tcp --permanent
重启防火墙
firewall-cmd --reload
1.1.1. 确认MySQL中已经有可以通过远程登录的账户
select * from mysql.user where user=‘li4‘ and host=‘%‘;
1.1.2. 如果没有用户,先执行如下命令
grant all privileges on *.* to li4@‘%‘ identified by ‘123123‘;