Why I get “MySQL error: mysql server has gone away” error during restore ?

During the restoring from backup process I keep getting the error: MySQL error: mysql server has gone away. What do I do?

There are 2 main causes and solutions for “MySQL server has gone away (error 2006)”.

1) Server timed out and closed the connection.

To fix it, check if that wait_timeout mysql variable in your my.cnf configuration file is large enough.

2) Server dropped an incorrect or too large packet. If mysql gets a packet that is too large or incorrect, it assumes that something has gone wrong with the client and that is why it closes the connection.

To fix the problem, you can increase the maximum packet size limit max_allowed_packet in ‘my.cnf’ file, eg. set max_allowed_packet = 128M,

After that restart your MySQL server: sudo /etc/init.d/mysql restart

PS:
my.cnf file – is a configuration file of MySQL database server on your web hosting.

2 thoughts on “Why I get “MySQL error: mysql server has gone away” error during restore ?

  1. Cindy

    Your site offered us with useful information. You’ve performed a formidable job and our entire group can be thankful to you. We solved many site issues thanks to answers found here

    Reply
  2. Will

    Hey very nice blog!! Man .. Excellent .. Amazing .. I will bookmark your site and take the feeds also I’m satisfied to find a lot of useful info right here within the posts

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

code