如题,放假在家玩树莓派集群,其中一台连不上数据库,今日怪事+1
============================================================================= 状态描述:
平台树莓派 4B,架构 armv7,系统 raspbian 最新( debian10 )
数据库版本 mariadb-server version: 10.3.22
安装 mariadb-server & client 后,
本地 mysql ( client ) 、以及 pypmyadmin可以连接数据库,工作正常。
远程连接( navicat 等)不能连接数据库,提示
>> mysql -h192.168.0.109 -uroot
ERROR 2002 (HY000): Can't connect to MySQL server on '192.168.0.106' (10061)
============================================================================= 配置方面,
/etc/mysql/my.cnf 中设置了绑定任意
[mysqld]
bind-address=0.0.0.0
数据库方面,select user,host from mysql.user; 返回
+------+------+
| user | host |
+------+------+
| root | % |
+------+------+
网络方面,ifconfig 显示
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.106 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::aff7:f451:c78e:c4eb prefixlen 64 scopeid 0x20<link>
ether dc:a6:32:10:7a:44 txqueuelen 1000 (Ethernet)
RX packets 123134 bytes 147417079 (140.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 49386 bytes 8702996 (8.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
远程连接能正确到达指定端口
C:\Windows\System32>tcping 192.168.0.106 3306
Probing 192.168.0.106:3306/tcp - Port is open - time=4.249ms
Probing 192.168.0.106:3306/tcp - Port is open - time=2.502ms
Probing 192.168.0.106:3306/tcp - Port is open - time=3.440ms
Probing 192.168.0.106:3306/tcp - Port is open - time=2.913ms
Ping statistics for 192.168.0.106:3306
4 probes sent.
4 successful, 0 failed. (0.00% fail)
Approximate trip times in milli-seconds:
Minimum = 2.502ms, Maximum = 4.249ms, Average = 3.276ms
感觉十分奇怪,第一次遇到这种情况,感觉配置和网络都没啥问题,不知道为啥连不上,求助。
1
jugelizi 2020-03-29 16:27:24 +08:00
你端口是不是没有允许外部访问
|
2
awanabe 2020-03-29 17:16:57 +08:00
修改完了 my.cnf 重启 mysql 没?
|
3
black11black OP |
4
hshpy 2020-03-29 18:23:58 +08:00 via iPhone
106 不是 109
|
5
laycher 2020-03-29 19:54:34 +08:00
mysql -h192.168.0.109 -uroot
ERROR 2002 (HY000): Can't connect to MySQL server on '192.168.0.106' (10061) ---- 这里写错了?到底是 106 还是 109 ? 要不换个端口试试? |
6
black11black OP |