问题:ERROR 2003 (HY000): Can’t connect to MySQL server on ‘172.16.160.182’ (111)
解决:
1、按照网上的方法说修改mysql的my.cnf中有下面一段代码:
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1 #这里默认监听本地localhost
如果要让mysql监听到其他的地址,可以将bind-address = 127.0.0.1注释掉。
或者将bind-address = 0.0.0.0监听所有的地址
但是….
我找了半天没找到bind-address = 127.0.0.1这个,原来我的在
cuishizhou01@cuishizhou01:/etc/mysql/mysql.conf.d$ ls
mysqld.cnf mysqld_safe_syslog.cnf
cuishizhou01@cuishizhou01:/etc/mysql/mysql.conf.d$
修改这里的mysqld.cnf看看