Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL error 2013

Tags:

mysql

In MySQL, how can I solve the error below?

2013: Lost connection to MySQL server at 'reading authorization packet', system error: 0
like image 387
user71723 Avatar asked Apr 20 '09 04:04

user71723


People also ask

How do I fix error code 2013 lost connection to MySQL server during query?

You can check this out by going to Server > Client Connections on MySQL Workbench and make sure there are no processes/queries still running that pertain to the import. Next, I would recommend increasing the timeout intervals for your MySQL Session. That can be found on MySQL Workbench under Edit > Preferences... >

How do I fix error code 2013?

You can edit the SQL Editor preferences in MySQL Workbench: In the application menu, select Edit > Preferences > SQL Editor. Look for the MySQL Session section and increase the DBMS connection read time out value. Save the settings, quite MySQL Workbench and reopen the connection.

What is lost connection to MySQL server during query?

The error above commonly happens when you run a long or complex MySQL query that runs for more than a few seconds. To fix the error, you may need to change the timeout-related global settings in your MySQL database server.


4 Answers

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

like image 161
Quassnoi Avatar answered Oct 23 '22 05:10

Quassnoi


Adding skip-name-resolve to my.cnf solved the problem for me.

like image 29
Kenneth Andreasen Avatar answered Oct 23 '22 07:10

Kenneth Andreasen


I had this same issue today and it turned out to be an issue with mysql 5.6.*. After uninstalling that and installing 5.5.36, I'm not getting this error anymore.

EDIT: On another computer, I was getting this error very consistently until I set this in my.cnf:

[mysqld]
max_allowed_packet = 32M

Well, technically, my error was slightly different:

_mysql_exceptions.OperationalError: (2013, "Lost connection to MySQL server at 'sending authentication information', system error: 32")

like image 32
Patrick Barry Avatar answered Oct 23 '22 06:10

Patrick Barry


I was having this problem too. For me the solution was to comment out the line:

skip_networking

I simply added the comment #, like this:

#skip_networking

And then I restarted mysql and it was all good!

Beware, this will disable all ability to make network connections to MySQL. If you are only using as localhost, it should be fine, but otherwise, watch out! :)

like image 44
ethanpil Avatar answered Oct 23 '22 06:10

ethanpil