Skip to content

Instantly share code, notes, and snippets.

@bllli
Last active November 6, 2018 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bllli/fa7f62382df3749b2842d9b49e388255 to your computer and use it in GitHub Desktop.
Save bllli/fa7f62382df3749b2842d9b49e388255 to your computer and use it in GitHub Desktop.
cosplay运维

0x01 检查防火墙是否放行3306

0x02 查看3306监听情况

$ netstat -an | grep 3306
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN

这样的就是3306端口只是在IP 127.0.0.1上监听,所以拒绝了其他IP的访问。

解决办法

vim /etc/mysql/my.cnf

bind-address = 127.0.0.1 -> # bind-address = 127.0.0.1

正常结果

$ netstat -an | grep 3306
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN

0x04 检查mysql账户是否拥有外网访问权限

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment