How to recover a MySQL database: Incorrect information in file: './xxx.frm'
disaster-recovery, mysql
Solution
This belongs on serverfault.
First, .FRM files contain none of your "data". They are simply the definition of the table.
If all of the following are true:
- The table is using the MyISAM storage engine
- You know the `CREATE TABLE` statement required to recreate the table
Then, do the following:
- Stop MySQL
- Backup your table_name.frm, table_name.MYI, table_name.MYD files
- Delete them from your mysql data directory (/var/lib/mysql usually)
- Start MySQL
- CREATE the table again
- Stop MySQL
- Copy the .MYD and .MYI files back into the datadir, replacing the ones there.
- Start MySQL
- ???
- Profit
Problem
A very important database has gone corrupt that was sitting on server at a shared web host, and I didn't back up. The table contains a large list of very important email addresses. I can get a table listing, but if I open any of the tables with Navicat or phpMyAdmin, I get the following error: Incorrect information in file: './the-table-name.frm' I was able to get a hold of the .frm files associated with the database from the web host. There is other data in there, but if I could at least get the email addresses, I would be alright. How do I recover this database? I would be willing to pay somebody to fix this.