数据库
首页 > 数据库> > 数据库远程连接报错ERROR 2003 (HY000): Can't connect to MySQL server on '10.102.169.77' (111)

数据库远程连接报错ERROR 2003 (HY000): Can't connect to MySQL server on '10.102.169.77' (111)

作者:互联网

1.报错如下:
ERROR 2003 (HY000): Can't connect to MySQL server on '10.102.169.77' (111)
ERROR 2003 (HY000): Can't connect to MySQL server on '10.0.0.163' (111 "Connection refused")

2.telnet也无法访问。检查3306端口也一直在打开。
3.检查后发现数据库监听在本地127.0.0.1所以无法访问。修改配置文件后让监听所有主机。
~ vim /etc/mysql/mariadb.conf.d/50-server.cnf
bind-address = 127.0.0.1 # 修改为0.0.0.0
4.重启数据库
~ systemctl restart mariadb
5.测试访问。
~ mysql -h 10.102.169.xx -P3306 -uhaitang -pxxxx
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 31
Server version: 10.1.48-MariaDB-0ubuntu0.18.03.1 Ubuntu 18.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

标签:10.102,169.77,HY000,server,报错,connect,MySQL,111,MariaDB
来源: https://www.cnblogs.com/xunweidezui/p/16503465.html