为 MySQL 提供服务的机器运行良好。另外 2 台机器使用 mysql-client 连接没有问题。网络上的 1 台机器自发停止连接。
我尝试过strace mysql -h server
,但尝试立即被拒绝
我不知道如何排除导致突然失败的原因。
编辑:抱歉。忘记添加错误了:
ERROR 2003 (HY000): Can't connect to MySQL server on 'server1:3308' (111)
这很有趣。另一台服务器访问数据库没有问题:
mysql -h server2 -P3308 -u root -p
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16591
Server version: 5.5.62 MySQL Community Server (GPL)
Copyright (c) 2000, 2025, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
因此,运行数据库的服务器没有问题。但由于某种原因,server1
它被拒绝连接。
身份验证允许从内联网内部进行远程连接。
任何谷歌搜索都假设问题出在服务器上而不是客户端上,所以我没有发现任何与客户端连接失败相关的客户端问题。
读过这篇文章的任何人都遇到过这样的问题并解决了吗?