centos7 MariaDB远程访问
1.连接到mysql,输入下边命令,然后输入mysql密码进入mysql命令行
mysql -uroot -p
2.输入下边的命令
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '123456' WITH GRANT OPTION; #123456是远程访问的密码,修改成你需要密码
flush privileges; #刷新一下
3.放行mysql端口或者关闭防火墙,退出mysql命令行后执行下边命令
systemctl stop firewalld.service #关闭防火墙
systemctl disable firewalld.service #禁止防火墙开机启动