数据库开启远程访问

先开放3306端口
#开放3306 firewall-cmd --permanent --add-port=3306/tcp systemctl restart firewalld.service #查看端口是否开放 firewall-cmd --query-port=3306/tcp
查看所有开放端口 #list firewall-cmd --list-all

最后修改数据库远程访问权限
mysql>use mysql
mysql>grant all privileges on *.* to 'root'@'%' identified by 'xxxxx(密码)';
mysql>flush privileges;
 
原文地址:https://www.cnblogs.com/didiaoge/p/10892326.html