Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

腾讯云服务器 系统centos:7.2
无法连接:(马赛克是ip地址)

clipboard.png

防火墙状态:

clipboard.png

mysql user表

clipboard.png

mysql配置文件(bind-address注释 skip-name-resolve已经添加)

clipboard.png

不知道为什么还是无法远程连接mysql,防火墙我都关掉试过,求给点办法,建议也行。

结论:加了个ip问题解决
grant all privileges on . to root@"XXX.XXX.XXX" identified by 'sjq&chenyi.12-345' with grant option;
其实user表的%代表了所有ip,因为没有密码就出问题了。
远程无法连接就4个问题:
1.防火墙:mysql端口是否对外 开放
2.bind-addres禁止
3.skip-name-resolve添加
4.访问者的ip是否被允许访问mysql


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
190 views
Welcome To Ask or Share your Answers For Others

1 Answer

比如你数据库主机IP是192.168.1.102,你本地是192.168.1.101

  • 授权新用户"user"@"192.168.1.%"

  • 数据库bind在192.168.1.102

  • 把iptables停掉试试


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...