123ArticleOnline Logo
Welcome to 123ArticleOnline.com!
ALL >> Computers >> View Article

Repairing Corrupt Mysql Database When You Encounter “mysql Server Has Gone Away” Error

Profile Picture
By Author: Manya Gupta
Total Articles: 5
Comment this article
Facebook ShareTwitter ShareGoogle+ ShareTwitter Share

MySQL is an open source database that has got a fair amount of users all over the world. It is fast, secure, reliable, and easy to use. Apart from being the most used open source database, it is an excellent option for the applications built on the LAMP (Linux, Apache, MySQL, PHP/Perl/Python) platform. It efficiently runs on various operating system platforms such as Windows, Linux, Macintosh, Solaris, etc. However, at times some inconsistencies occur in the MySQL database that could lead to database corruption. The reasons behind such situations could be virus infections, human errors, abrupt system shutdown while the database is open, power surges, etc. In such cases, you should consider taking appropriate corrective measures to sort the issue. However, if you are unable to do so then you should use a third-party MySQL database recovery software to recover MySQL database.

Consider a scenario wherein you are working on a MySQL database. You try to execute a query but are unable to do so. One of the following error messages may be displayed ...
... in such case:

MySQL server has gone away
Lost connection to server during query

Cause:
There could be the following reasons for this error messages:
The server timed out and the connection is now closed.
You have closed the connection yourself and are now trying to run the query on the closed connection.
The TCP/IP connection on the client side has timed out.
A timeout has occurred on the server side and the automatic reconnection on the client side is disabled.
You have issued a query that is either too large or too complex.

However, if the aforementioned reasons have not caused the error message that means that the MySQL database is corrupt.

Resolution:
to resolve the issue, you can perform either of the following methods:
If the connection is closed, then you should reestablish the connection and see if it works well.
Run the OPTIMIZE TABLE command. If you get the "ERROR 1030 (HY000): Got error 28 from storage engine" message, then this would mean that there is no space in the drive to get the query result. Then, to repair the database by optimizing it, you need to perform the following steps:
Add the following line in the mysqld section in my.cnf:
innodb_force_recovery=4
Stop mysqld and restore data backup to mysqld data folder.
Restart mysqld and perform a thorough check on your tables.
Try to execute a large query.
Optimize all the database tables.

However, if you are not able to recover MySQL database using the aforementioned methods then you should use a third-party MySQL database repair tool to do so. Such read-only tools are able to recover MySQL database using fast yet sophisticated scanning algorithms.

Stellar Phoenix MySQL Database Recovery is a MySQL repair software that enables you to recover MySQL databases. This tool is able to repair MySQL components such as tables, views, etc. It is compatible with Windows 7, Vista, Server 2003, XP, and 2000.

Total Views: 193Word Count: 477See All articles From Author

Add Comment

Computers Articles

1. Web Scraping Top Grocery Chains In Michigan
Author: FoodDataScrape

2. How Refurbished Laptops Help Students Save Money And Study Smarter In 2025
Author: usedstore

3. Why The Ls3002 Barcode Scanner Is Perfect For Retail In 2025
Author: prime pos

4. Does Cleaning Temporary Files Really Improve Laptop Speed? (what To Expect)
Author: Neha Jain

5. Extract Supermarket Data From Walmart & Target In Usa
Author: FoodDataScrape

6. How Odoo Partners Drive Growth: From Implementation To Innovation
Author: Alex Forsyth

7. Leverage Web Scraping Cold Drinks Data On Swiggy Instamart
Author: FoodDataScrape

8. Empowering Universities Through Student Engagement Crm Solutions|e2s
Author: Brenda Joyce

9. Odoo Manufacturing And Lean Practices For Small And Medium Enterprises
Author: Alex Forsyth

10. How Posiflex Pos Machines Enhances Customer Service
Author: pbs

11. Scrape Keeta Food Delivery App Data In Saudi Arabia For Insights
Author: FoodDataScrape

12. Microsoft Office Professional Plus 2021 Vs. Microsoft Office Professional Plus 2024: Which One Should You Choose?
Author: davudobuya55

13. Microsoft Office Professional Plus 2019 Vs. Microsoft Office Professional Plus 2019 Dvd: Which Version Should You Choose?
Author: davudobuya55

14. Microsoft Office Professional 2024 Vs. Microsoft Office Professional Plus 2010: Which One Is Right For You?
Author: davudobuya55

15. Microsoft Office Home Business 2021 For Mac Vs Microsoft Office Home Student 2021 For Mac: Which Is Right For You?
Author: davudobuya55

Login To Account
Login Email:
Password:
Forgot Password?
New User?
Sign Up Newsletter
Email Address: