Linux开放mysql权限给任意主机远程登陆
一、开放3306端口
1、vim /etc/sysconfig/iptables
2、重启防火墙
service iptables restart
3、查看3306端口是否开启
service iptables status
二、授权远程连接
grant all privileges on *.* to 'xxxx'@'%'identified by 'xxxx' with grant option;
第一个xxxx是用户名,第二个xxxx是密码,意思是通过xxxx用户和密码可以从任何主机连接到mysql服务器。
让权限立即生效:flush privileges;