17

In MySQL, how can I solve the error below?

2013: Lost connection to MySQL server at 'reading authorization packet', system error: 0
Mark Amery
  • 143,130
  • 81
  • 406
  • 459
user71723
  • 343
  • 3
  • 5
  • 13

7 Answers7

12

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

Quassnoi
  • 413,100
  • 91
  • 616
  • 614
4

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

Mihai Iorga
  • 39,330
  • 16
  • 106
  • 107
3

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")

Patrick Barry
  • 143
  • 2
  • 9
1

If you are using Mac OS X and MySQL 5.6.6 or later, the default value of innodb_file_per_table was changed to ON. Setting innodb_file_per_table = OFF might fix your issue. See Mysql 5.6 headaches on Mac OSX and http://bugs.mysql.com/bug.php?id=71960

Community
  • 1
  • 1
1

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! :)

ethanpil
  • 2,522
  • 2
  • 24
  • 34
  • why am I voted down? I had a legitimate answer to this exact problem which was solved!? – ethanpil Nov 30 '11 at 17:30
  • 5
    skip_networking would stop all socket connections to the database server from outside. Only local servers would be able to connect. – Pradeep Dec 01 '11 at 15:46
  • 2
    So what? It still solved the problem for my case, which had nothing to do with remote access. – ethanpil Jan 18 '12 at 07:25
0

Check your my.cnf file. set the bind-address to the server's actual IP address.

Dennis Day
  • 607
  • 2
  • 5
  • 13
0

Take a look at your mysqld log file - there's a high chance 'show status' crashes MySQL for some reason.

grateful.dev
  • 1,437
  • 10
  • 21