设置远程连接能力
授于root账户所有权限
GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "rw";
flush privileges;
exit;
设置允许远程访问
1)关闭防火墙
#关闭服务
systemctl stop firewalld
#开机禁用
systemctl disable firewalld
2)开放3306端口 firewalld 防火墙(centos-7)运行命令,并重启:
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload