Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
share|improve this question

2 Answers 2

up vote 1 down vote accepted
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
share|improve this answer
    
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 '12 at 16:48

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

myisamchk --recover tbl
myisamchk --save-recover tbl
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.