[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:

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

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

Post navigation

Arunlal Ashok

Linux Systems Architect at Endurance International Group. I know her (Linux) since many years. Linux lover. Like to play on Linux console. I started this blog to share and discuss Linux thoughts.

Always happy for an open discussion! Write to arun (@) crybit (dot) com. Check about me for more details. About this blog and our strong members, check The team CryBit.com

Leave a Reply

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