Post Views: 4,193
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
Senior System Developer at Zeta. Linux lover. Traveller.
Let's connect! Whether you're a seasoned DevOps pro or just starting your journey, I'm always eager to engage with like-minded individuals. Follow my blog for regular updates, connect on social media, and let's embark on this DevOps adventure together!
Happy coding and deploying!
Can you please explain how to repair Innodb database in a shared server.