文章目录

场景

  • 环境
    • ubuntu16.04
  • 负载均衡的2台机器使用同一台服务器上的数据库,在创建一个可以远程连接的用户,并且付给这个数据库的读写权限后, 连接数据库遇到了这个问题

分析

/etc/mysql/mysql.conf.d/mysqld.cnf

#Instead of skip-networking the default is now to listen only on
#ocalhost which is more compatible and is not less secure.
bind-address = 127.0.0.1

mysql 默认只监听127.0.0.1

解决

  • bind-address = 127.0.0.1 换成内网IP
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐