Mysql开启远程服务

开启远程服务:

登录mysql:

//赋予root用户所有权限,远程登录密码是123456

grant all privileges on *.* to root @% identified by 123456;
flush privileges;

设置Linux的防火墙:

Linux防火墙默认拦截3306端口

/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
/etc/rc.d/init.d/iptables save