mysql could not start multiple solutions reporting an error2013 error

  • 2020-06-23 02:06:50
  • OfStack

Mysql mysql lost to server during query problem solution

Why: This happens when you query a database in Mysql or modify a large table;
google:
Scenario 1. Add a line below the mysql profile [myslqd] to set skip-ES18en-ES19en. You need to restart the mysql service.

Scheme 2. Add :ip to the hosts file, for example: 127.0.0.1 localhost. This does not restart the mysql service.
---------------------------
Solve this problem on three levels:

1. At the code level, you need to add something like this to your PHP database connection.


if( in_array(mysql_errno(), array(2006, 2013))){
mysql_close();
mysql_connect(...);
mysql_query(...);
}

That is to say, in case of 2006,2013 error, reconnect 1 MySQL.
2. MySQL level, need to configure 1 some parameters my.cnf (but here is linux, what about my windows configuration?)
wait_timeout = x timeout time is 600 seconds
max_allowed_packet = y Maximum allowable data volume
Increase the value of x,y appropriately.

3. 1 This usually happens not in all examples but in a single table. Please fix table 1 first.
----------------------
MySQL Error 2013: Lost connection to MySQL server during query
Error code: 1153-ES63en packet bigger than 'max_allowed_packet' bytes
Solutions:
Modify ES74en. ini (it is said that this file on the Internet, looking for N for a long time finally know where, my directory is in D:\MySQL_Data\MySQL Server 5.5 under MySQL_Data folder) file add the following code
max_allowed_packet=500M


Modify F:\program\mysql5.0\ my-ES93en.ini if this is not possible

In max_allowed_packet = 16 M changed 16 to 500 / / / / / / / / / / / / / I use this method to solve the 2014-6-4 19:58 / / / / / / / / / /

My personal understanding is to change the maximum allowable memory provided by the mysql configuration after all 16M May not be enough
I did it this way. Try it
----------------------
4. It can be set directly in mysql:

#show variables like '%timeout%';
#show variables like 'max_allowed_packet'
set global wait_timeout=60000;
#set global max_allowed_packet = 2*1024*1024


Related articles: