[Solved] : MySQL server has gone away – error while restoring the DB

Today I got one error  while restoring the database backup file from the command line. Error message is shown below:
Error:

# mysql database_name < database_back.sql
--------
at line 4511: MySQL server has gone away.
--------  

Solution:
Check the value for the mysql directive “max_allowed_packet” in mysql configuration file “my.cnf”. Increase the value to higher to avoid the error.

# vi /etc/my.cnf
--------
max_allowed_packet=64M    #try higher values if problem persist.    
--------

Click here for cPanel conf details.

Then restart the mysql daemon.

# service mysql restart

After restarting the mysql service try again to restore the DB backup.
That’s it!!! 🙂

Related errors:
[Solved]1045 Cannot log in to the MySQL server : PhpMyAdmin error
Databases showing 0MB in cPanel

Arunlal Ashok

Linux Server Administrator. I'm dealing with Linux servers since 2012. I started this blog to share and discuss my ideas with the world. Check My Profile!! in uPwork (oDesk) and let me know if you need any assistance. Thanks!!

You may also like...

Leave a Reply

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