错误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.

我在做什么:

  • 我有Master-MySQL中的从属复制正在运行,并且刚刚使用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服务器的日志传递给我,并且我已经剔除了它所需要的一切.
以下是输出:

Alterd the connect_timeout to 10.
So it seems i get no response for the server i have created on my F5
I finally convinced the F5 admin to pass me the log for the F5 server and i have exctraced all i need form it.
Here is the output :

  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 全部Thx

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

另一种样式:

Another style:

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

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

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

客户端(Windows平台上的某些应用程序)含糊不清 像Connection unexpectedly terminated这样的描述.

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): Lost connection to MySQL server at 'reading initial communication packet', system error: 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