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

前端 未结 11 2273
眼角桃花
眼角桃花 2020-11-30 03:29

I am getting the following error

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

相关标签:
11条回答
  • 2020-11-30 03:52

    I got both errors: mostly reading initial communication packet and reading authorization packet one time. It seems random, but sometimes I was able to establish a connection after reboots, but after some time the error creeped back.

    Avoiding the 5GHz WiFi in the client seems to have fixed the issue. That's what worked for me (server was always connected to 2.4GHz).

    I tried everything from server versions, odbc connector versions, firewall settings, installing some windows update (and then uninstalling them), some of the answers posted here, etc... lost my entire sleep time for today. Super tired day awaits me.

    0 讨论(0)
  • 2020-11-30 03:53

    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 to the MySQL server.

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

    3. 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

    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
    

    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
    
    0 讨论(0)
  • 2020-11-30 03:53

    In my case, it happened when there were a lot of connection to the MySQL server (15,000 connections) and the free memory was about 120M . After I added more memory to the server, the error was gone.

    0 讨论(0)
  • 2020-11-30 03:54

    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:

    mysql> SET GLOBAL connect_timeout = 10;
    

    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 it through 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.

    0 讨论(0)
  • 2020-11-30 03:57

    My case was that the server didn't accept the connection from this IP. The server is a SQL server from Google Apps Engine, and you have to configure allowed remote hosts that can connect to the server.

    Adding the (new) host to the GAE admin page solved the issue.

    0 讨论(0)
提交回复
热议问题