美文网首页
新装Mysql 无法远程连接 解决方法

新装Mysql 无法远程连接 解决方法

作者: 晓阿狸酱 | 来源:发表于2018-07-18 10:54 被阅读0次

1.检查防火墙

执行iptables -nL --line-number ,查看3306端口是否开放

如未开放

执行 iptables -A INPUT -p tcp --dport 3306 -j ACCEPT

2.修改授权

mysql -uroot -ppassword

use user;

create user test identified by '123456';

grant all privileges on *.* to 'test'@'%' identified by '123456' with grant option;

flush privileges;

3.检查mysql配置

检查mysql配置文件中my.cnf   bind-address = 127.0.0.1 是否屏蔽

修改 bind-address = 127.0.0.1 ==》 #bind-address = 127.0.0.1

4.如果是云服务器检查安全组策略,开放3306端口


相关文章

网友评论

      本文标题:新装Mysql 无法远程连接 解决方法

      本文链接:https://www.haomeiwen.com/subject/edjuzxtx.html