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

4 down vote accepted

From documentation:

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.

Try increasing connect_timeout in your my.cnf file

Another style:

MySQL: Lost connection to MySQL server at 'reading initial communication packet'

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

  2. The client (some application on a Windows platform) gave a vaguedescription likeConnection unexpectedly terminated.

  3. When remotely logging in with the MySQL client the following errorappeared:

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

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

mysqld: ALL: 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

or check if the host is listed in /etc/hosts.deny.

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

mysqld: ALL


This is usually caused by an aborted connect. You can verify this by checking the status:

mysql> SHOW GLOBAL STATUS LIKE 'Aborted_connects';

If this counter keeps increasing as you get the lost connections, that's a sign you're having a problem during connect.

One remedy that seems to work in many cases is to increase the timeout. A suggested value is 10 seconds:

貌似有效的设置方法

1. mysql> SET GLOBAL connect_timeout = 30;
2.
在文件my.ini  或者my.cnf中添加或更改一个参数:
connect_timeout=30

Another common cause of connect timeouts is the reverse-DNS lookup that is necessary when authenticating clients. It is recommended to run MySQL with the config variable in my.cnf:

[mysqld]
skip-name-resolve

This means that your GRANT statements need to be based on IP address rather than hostname.


I also found this report from 2012 at the f5.com site (now protected by login, but I got itthrough Google cache)

It is likely the proxy will not work unless you are running BIG-IP 11.1 and MySQL 5.1, which were the versions I tested against. The MySQL protocol has a habit of changing.

I suggest you contact F5 Support and confirm that you are using a supported combination of versions.



Another possibility can be connection reset from the TCP wrappers (/etc/hosts.deny and /etc/hosts.allow). Just check what is coming in from the telnet to port 3306 - if it is nothing, then there is something is in the middle preventing communication from happening.




  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当出现“lost connection to mysql server at ‘reading authorization packet’, system”错误时,意味着客户端无法正确连接到MySQL服务器,并且故障通常是由以下原因之一引起的: 1. 网络问题:可能是网络连接不稳定或网络延迟导致连接丢失。这可能是由于网络故障或服务器故障引起的。 解决方法:检查网络连接并确保网络稳定。尝试重新连接MySQL服务器,如果问题持续存在,可能需要联系系统管理员或网络服务提供商以解决网络问题。 2. 认证错误:可能是由于客户端提供的凭据与MySQL服务器的凭据不匹配引起的。这可能是由于密码错误或用户名错误等问题引起的。 解决方法:检查提供的用户名和密码是否正确,并确保它们与MySQL服务器上配置的凭据匹配。可以尝试使用正确的凭据重新连接MySQL服务器。 3. 服务器过载或故障:可能是由于MySQL服务器负载过重或发生故障导致无法处理连接请求。 解决方法:检查MySQL服务器的负载和状态。如果服务器过载,可以尝试等待一段时间再尝试连接。如果服务器发生故障,可能需要联系系统管理员或数据库管理员以解决问题。 综上所述,当出现“lost connection to mysql server at ‘reading authorization packet’, system”错误时,我们应该首先检查网络连接,确保网络稳定;然后检查提供的凭据是否正确;最后,检查MySQL服务器的负载和状态。根据具体情况采取适当的解决方法,可能需要与系统管理员、网络服务提供商或数据库管理员进行进一步的沟通和协调。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值