How to restore MySQL database: incorrect information in the file: './xxx.frm'

A very important database is corrupted, which sits on a server on a shared website, and I did not support it. The table contains a long list of very important email addresses. I can get a list of tables, but if I open any of the tables using Navicat or phpMyAdmin, I get the following error:

Incorrect file information: './the-table-name.frm'

I was able to capture .frm files related to the database from the website.

There is other data there, but if I could at least get the email addresses, I would be fine.

How to restore this database? I would be willing to pay someone to fix it.

+6
mysql disaster-recovery
source share
3 answers

This applies to serverfault.

Firstly, .FRM files do not contain any of your "data." This is just a table definition.

If all of the following statements:

  • The table uses the MyISAM storage engine
  • You know the CREATE TABLE statement needed to recreate the table.

Then do the following:

  • Stop mysql
  • Backing up table_name.frm, table_name.MYI, table_name.MYD files
  • Remove them from your mysql data directory (usually / var / lib / mysql)
  • Start mysql
  • CREATE a table again
  • Stop mysql
  • Copy the .MYD and .MYI files back to datadir, replacing them there.
  • Start mysql
  • ???
  • Profit
+14
source share

I had a similar problem, it turned out that the MySQL InnoDB engine was disabled (I was able to check through phpMyAdmin, bash pro could tell you how to do this in other ways). in my case it was just like restarting MySQL, but you can check your configuration if something has changed there.

0
source share

You can try the following commands: CHECK TABLE tablename

If this gives a “damaged” message, try:

REPAIR TABLE tablename

Actually, this does not solve my similar problem, but they can be useful for someone.

0
source share

All Articles