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

前端 未结 11 2272
眼角桃花
眼角桃花 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:32

    I've struggled a lot with this error. Tried every single answer I found on the internet.

    In the end, I've connected my computer to my cell phone's hotspot and everything worked. I turned out that my company's internet was blocking the connection with MySQL.

    This is not a complete solution, but maybe someone faces the same problem. It worths to check the connection.

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

    I solved this by stopping mysql several times.

    $ mysql.server stop
    Shutting down MySQL
    .. ERROR! The server quit without updating PID file (/usr/local/var/mysql/xxx.local.pid).
    $ mysql.server stop
    Shutting down MySQL
    .. SUCCESS! 
    $ mysql.server stop
    ERROR! MySQL server PID file could not be found! (note: this is good)
    $ mysql.server start
    

    All good from here. I suspect mysql had been started more than once.

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

    If you get this when using DevDesktop - just restart DevDesktop!

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

    I use several mysql connections (connecting to different sets of databases) in localhost.

    This happened to me after I shut my computer down and mysql was not properly shutdown. After starting my machine I was able to successfully connect to multiple db connections except one (I used this a lot before my machine shutdown). As per the instructions in this posts I doubled connect_timeout but I was not able to connect to that one database connection.

    I restarted my machine and i can successfully connect now. This will help you unblock yourself but it'd be great if it can be fixed without restarting the machine.

    Another concern is: connection_timeout seemed to me delay related problem but I was getting the error immediately in localhost when there is no network in the equation.

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

    I have a mac but would assume all linux are the same for this part...

    In my case I got this:

    2018-12-03 11:13:27 - Start server: 
    2018-12-03 11:13:27 - Server start done.
    2018-12-03 11:13:27 - Checking server status...
    2018-12-03 11:13:27 - Trying to connect to MySQL...
    2018-12-03 11:13:27 - Lost connection to MySQL server at 'reading authorization packet', system error: 0 (2013)
    2018-12-03 11:13:27 - Assuming server is not running
    

    I ran this:

    sudo killall mysqld
    

    And then started the mysql again through mysqlworkbench although in your case it might be like this:

    mysql.server start
    

    *sidenote: I tried running mysql.server stop and got this Shutting down MySQL .... SUCCESS! but after running ps aux | grep mysql I saw that it hasn't really shut down...

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

    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.

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