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?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted 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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.