错误 2013 (HY000):在“读取授权包"时失去与 MySQL 服务器的连接,系统错误:0

ERROR 2013 (HY000): Lost connection to MySQL server at #39;reading authorization packet#39;, system error: 0(错误 2013 (HY000):在“读取授权包时失去与 MySQL 服务器的连接,系统错误:0)

本文介绍了错误 2013 (HY000):在“读取授权包"时失去与 MySQL 服务器的连接,系统错误:0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下错误

ERROR 2013 (HY000): Lost connection to MySQL server at 
'reading authorization packet', system error: 0

尝试连接到我的 MySQL 服务器时.

when trying to connect to my MySQL server.

我在做什么:

  • 我在 MySQL 中有 Master - Slave 复制,它正在工作,并且刚刚使用 F5 添加了负载平衡功能.
  • 我已经根据他们的网站配置了 F5.

但是当我尝试使用 F5 配置的 IP 连接到我的 MySQL 服务器时,我得到

But when I am trying to connect to my MySQL server using the IP that the F5 was configured with I get

ERROR 2013 (HY000): Lost connection to MySQL server at 
'reading authorization packet', system error: 0 

有什么想法吗?

我的进度更新:
- 我遇到了同样的错误我在/var/log/secure 中没有任何条目,好像有人会尝试对来自我创建负载平衡服务器的 IP 进行身份验证.
mysql 错误日志中没有条目.
命令 - 不返回任何内容

Update on my progress : ZERO
- i am getting the same error I get no entries in the /var/log/secure as if somebody would try to authenticate coming form the ip where i had created my load balance server.
No enties in the mysql error log.
The command - returns nothing

mysql> SHOW GLOBAL STATUS LIKE 'Aborted_connections';
Empty set (0.00 sec)

我已经修改了我的 my.cnf 文件并添加了

I've already altered my my.cnf file and add the

[mysqld]
skip-name-resolve

connect_timeout 更改为 10.
因此,我在 F5 上创建的服务器似乎没有响应
我终于说服了 F5 管理员将 F5 服务器的日志传递给我,我已经从它那里提取了我需要的所有内容.
这是输出:

  Jan 28 15:46:39 tmm debug tmm[6459]: Rule /Common/iRule-f5_mysql_proxy <CLIENT_ACCEPTED>: BIG-IP MySQL Proxy -- clientside initial connection
Jan 28 15:46:39 tmm debug tmm[6459]: Rule /Common/iRule-f5_mysql_proxy <CLIENT_ACCEPTED>: BIG-IP MySQL Proxy -- clientside responding with server WELCOME packet
Jan 28 15:46:39 tmm debug tmm[6459]: Rule /Common/iRule-f5_mysql_proxy <CLIENT_DATA>: BIG-IP MySQL Proxy -- clientside authenticated flag not set
Jan 28 15:46:39 tmm err tmm[6459]: Rule /Common/iRule-f5_mysql_proxy <CLIENT_DATA>: BIG-IP MySQL Proxy -- mysql client: attempting to do something before authentication
Jan 28 15:46:39 tmm debug tmm[6459]: Rule /Common/iRule-f5_mysql_proxy <LB_SELECTED>: BIG-IP MySQL Proxy -- serverside selected pool /Common/foss-mysql-slave_pool node SLAVE-IP
Jan 28 15:46:39 tmm debug tmm[6459]: Rule /Common/iRule-f5_mysql_proxy <CLIENT_CLOSED>: BIG-IP MySQL Proxy -- clientside connection closed from MASTER-IP(XXXXXXX)
Jan 28 15:46:39 tmm debug tmm[6459]: Rule /Common/iRule-f5_mysql_proxy <SERVER_CLOSED>: BIG-IP MySQL Proxy -- serverside connection closed from node SLAVE-IP(XXXXXXXX)

为了安全起见,我已经更换了ip!

I've replaced the ip for security sake !

作为额外的 - 我认为问题就在这里 - 我的 mysql 版本是 5.1.69-log谢谢所有

just as an extra - and i think is here the problem - my mysql version is 5.1.69-log Thx All

推荐答案

来自文档:

更罕见的是,当客户端尝试初始连接到服务器.在这种情况下,如果您的 connect_timeout 值设置为只有几秒钟,您也许可以解决问题通过将其增加到十秒,如果您有很长的时间,可能会更多距离较远或连接速度较慢.你可以确定你是否通过使用 SHOW STATUS LIKE 来体验这个更不常见的原因'aborted_connections'.每个初始值都会增加一服务器中止的连接尝试.您可能会看到阅读授权包"作为错误消息的一部分;如果是这样,那也表明这是您需要的解决方案.

More rarely, it can happen when the client is attempting the initial connection to the server. In this case, if your connect_timeout value is set to only a few seconds, you may be able to resolve the problem by increasing it to ten seconds, perhaps more if you have a very long distance or slow connection. You can determine whether you are experiencing this more uncommon cause by using SHOW STATUS LIKE 'aborted_connections'. It will increase by one for each initial connection attempt that the server aborts. You may see "reading authorization packet" as part of the error message; if so, that also suggests that this is the solution that you need.

尝试增加 my.cnf 文件中的 connect_timeout

Try increasing connect_timeout in your my.cnf file

另一种风格:

MySQL:在读取初始通信数据包"时失去与 MySQL 服务器的连接

  1. 在某些时候,远程客户端无法连接到MySQL 服务器.

  1. At some point, it was impossible for remote clients to connect to the MySQL server.

客户端(Windows 平台上的一些应用程序)给出了一个模糊的类似连接意外终止的描述.

The client (some application on a Windows platform) gave a vague description like Connection unexpectedly terminated.

用MySQL客户端远程登录时出现如下错误出现:

When remotely logging in with the MySQL client the following error appeared:

ERROR 2013 (HY000): 在读取初始通信数据包"时失去与 MySQL 服务器的连接,系统错误:0

在 FreeBSD 上,发生这种情况是因为在 /etc/hosts.allow 中找不到匹配项. 在说 ALL:ALL 的行之前添加以下行可解决此问题:

On FreeBSD this happens because there was no match found in /etc/hosts.allow. Adding the following line before the line saying ALL:ALL fixes this:

mysqld: ALL: allow

在非 FreeBSD Unix 系统上,值得检查文件 /etc/hosts.allow/etc/hosts.deny. 如果您限制连接, 确保这一行在 /etc/hosts.allow:

On non-FreeBSD Unix systems, it is worth to check the files /etc/hosts.allow and /etc/hosts.deny. If you are restricting connections, make sure this line is in /etc/hosts.allow:

mysqld: ALL

或检查主机是否在 /etc/hosts.deny 中列出.

在 Arch Linux 中,可以在 /etc/hosts.allow 中添加类似的行:

In Arch Linux, a similar line can be added to /etc/hosts.allow:

mysqld: ALL

这篇关于错误 2013 (HY000):在“读取授权包"时失去与 MySQL 服务器的连接,系统错误:0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:错误 2013 (HY000):在“读取授权包"时失去与 MySQL 服务器的连接,系统错误:0

基础教程推荐