mysql ERROR 2003 (HY000):Can't connect to MySQL server on
文章目录场景分析解决场景环境ubuntu16.04负载均衡的2台机器使用同一台服务器上的数据库,在创建一个可以远程连接的用户,并且付给这个数据库的读写权限后, 连接数据库遇到了这个问题分析/etc/mysql/mysql.conf.d/mysqld.cnf#Instead of skip-networking the default is now to listen o...
·
场景
- 环境
- 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.1mysql 默认只监听127.0.0.1
解决
- bind-address = 127.0.0.1 换成内网IP
更多推荐
所有评论(0)