mysql 任意连接

例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。

mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

此时检查下防火墙是否开启:

/etc/init.d/iptables status

会得到一系列信息,说明防火墙开着。则关闭:

/etc/init.d/iptables stop

永久关闭::----可以使用一种配置运行mysql:3306端口暴露的配置,而不是把整个防火墙都关闭

chkconfig --level 35 iptables off

再次连接,可以了

原文地址:https://www.cnblogs.com/zero530/p/5022556.html