Database on MySQL Server

March 29, 2018 939 views

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?

1 Answer
NoaWood March 30, 2018
Accepted Answer

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

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.

Have another answer? Share your knowledge.