2

I've recently suffered from a power outage on one of my monitoring servers at the office. The result of that outage caused for some database tables to get corrupted.

I've successfully repaired 3-4 tables by using the "use_frm" option however there are still 3 that seem to be badly corrupted and are not responding to the mysql REPAIR command (with or without use_frm)

mysql> REPAIR TABLE poller_item;
+-------------------+--------+----------+----------------------------------------------       ------------+
| Table             | Op     | Msg_type | Msg_text                                                    |
+-------------------+--------+----------+-------------------------------------------------  ---------+
| cacti.poller_item | repair | Error    | Incorrect information in file:    './cacti/poller_item.frm' |
| cacti.poller_item | repair | error    | Corrupt                                                      |
+-------------------+--------+----------+-------------------------------------------------  ---------+

In this scenario are there any other way to repair a table?

MySQL Version

mysql  Ver 14.14 Distrib 5.1.49, for debian-linux-gnu (x86_64) using readline 6.1

3 Answers 3

3
Incorrect information in file:    './cacti/poller_item.frm'

.frm file stores the table format. Try this:

  • Stop MySQL
  • Take the backup of poller_item.frm, poller_item.MYD, poller_item.MYI
  • Drop the poller_item table
  • Start MySQL
  • Recreate poller_item table by using CREATE TABLE statement in cacti.sql (uses the corresponding version that you're running)
  • Stop MySQL
  • Copy the poller_item.MYD, poller_item.MYI into the datadir
  • Start MySQL again
2
  • 1
    This fixed the issue. It's important to note for future people experiencing this issue that after I had completed the above steps I also needed to do a REPAIR TABLE poller_item use_frm; Thanks!
    – Nick M.
    Aug 29, 2012 at 16:48
  • @quanta I don't have .MYD & MYI. but have .ibd file so will those same steps work for innodb also Aug 31, 2016 at 0:12
0

take backup first and then try try MYISAMCHK(1):

myisamchk --recover tbl
myisamchk --save-recover tbl
0

I had same problem in mariadb (mysql) for 5 tables "in use".

message after check or repair was

Incorrect information in file:    './tablename.frm'
Corrupted 

In database folder, these frm files had 0 size. So, i stopped mariadb service and then just overwrite them with frm files from backup. Then I started again mariadb service and tables where fixed. NOTICE: First, I tested this solution with a table that had only 1-2 rows of data, to be sure that it works. I had also azure backup, so if that didnt work, I could rollback to previous hour.

Good luck!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .