I was working with MySQL 8.0 database during some hard hours. I turned off my machine and went out. After I restarted my machine and tried to open database, I saw Table is crashed and last repair failed. I need to extract all the data from the table or to solve this trouble. What do you suggest to do?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Quite often mysql restore tool might help or alternative the guide below can be effective too…

https://www.restoretools.com/mysqlrestore.html

In most cases, only the index will be corrupted (the index is a separate, smaller, file with records that point to the main data file) - actual data corruption is extremely rare. Fixing most forms of corruption is relatively easy. As with checking, there are three ways to repair tables. These all only work with MyISAM tables - to repair corruption of the other table types, you will need to restore from backup:

• The REPAIR TABLE SQL statement (obviously the server must be running for this)
• The mysqlcheck command-line utility (the server can be running)
• The myisamchk command-line utility (the server must be down, or the tables inactive)

Repairing a table requires twice as much disk space as the original table (a copy of the data is made), so make sure you are not going to run out of disk space before you start.

Submit an Answer