Post Views: 4,998
Managing MySQL server is one of the interesting thing for every sys admins.
In this article I’m just sharing a quick fix for the error that I got while restoring the database from its backup file. I hope this will be helpful for you guys too.
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
We all need fast, reliable and secure environment for our online space. Almost all websites has its own databases to store its data. MySQL is one of the most widely using relational database service to manage user databases. For a better performance we need MySQL tweaking.
It’s open source and its usages are really simple and user friendly.
In a shared server, the MySQL service itself can cause high load (CPU usage), memory usages or any other resources usages and then it cause the system unresponsive. A proper optimization can bring things down to its normal state.
Always do optimizations before going with hardware upgrade, like RAM, CPU and HDD.. We can save a lot of money by doing so! Simply,improve the performance of server without any hardware upgrade.
A proper MySQL optimization can drop the total load load on the server about half. Cool!!
Post navigation
Arunlal A
Engineer. Linux enthusiast. Traveller. DevOps learner and practitioner.
I enjoy working with Linux, DevOps, automation, and technology while exploring new places along the way. I use this space to share my experiences, learnings, experiments, and things I discover along the journey.
Whether you're a seasoned DevOps professional or just getting started, let's connect, learn, and grow together.
Happy coding, automating, and deploying!
Can you please explain how to repair Innodb database in a shared server.