MySQL table key corruption problem

Dan Coutu coutu at snowy-owl.com
Thu Apr 15 10:38:07 EDT 2010


I've spent a couple hours trying to track down a solution to this.
Perhaps one of you knows of a solution or at least can point me at some
new information that would help resolve it.

I have an openfire IM server running on RHEL 5. Apparently due to a
MySQL bug I have a problem with a key file related to one of the tables
used by openfire. I could not repair the table and found some references
that indicated that upgrading MySQL could very well fix it. So I
upgraded to 5.1.45 of MySQL but the problem remains. Here's an example
of what I'm seeing.

mysql> analyze table ofPubsubNodeJIDs;
+-------------------------+---------+----------+-------------------------------------------------------------------+
| Table                   | Op      | Msg_type |
Msg_text                                                          |
+-------------------------+---------+----------+-------------------------------------------------------------------+
| jabber.ofPubsubNodeJIDs | analyze | Error    | Incorrect key file for
table 'ofPubsubNodeJIDs'; try to repair it |
| jabber.ofPubsubNodeJIDs | analyze | error    |
Corrupt                                                           |
+-------------------------+---------+----------+-------------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> repair table ofPubsubNodeJIDs extended;
+-------------------------+--------+----------+-------------------------------------------------------------------+
| Table                   | Op     | Msg_type |
Msg_text                                                          |
+-------------------------+--------+----------+-------------------------------------------------------------------+
| jabber.ofPubsubNodeJIDs | repair | Error    | Incorrect key file for
table 'ofPubsubNodeJIDs'; try to repair it |
| jabber.ofPubsubNodeJIDs | repair | error    |
Corrupt                                                           |
+-------------------------+--------+----------+-------------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> repair table ofPubsubNodeJIDs quick;
+-------------------------+--------+----------+-------------------------------------------------------------------+
| Table                   | Op     | Msg_type |
Msg_text                                                          |
+-------------------------+--------+----------+-------------------------------------------------------------------+
| jabber.ofPubsubNodeJIDs | repair | Error    | Incorrect key file for
table 'ofPubsubNodeJIDs'; try to repair it |
| jabber.ofPubsubNodeJIDs | repair | error    |
Corrupt                                                           |
+-------------------------+--------+----------+-------------------------------------------------------------------+
2 rows in set (0.00 sec)

As you can see the suggestion to try to repair the table is not really
helpful because the repair operation fails!

I've also found suggestions that indicate that if all else fails then
the use_frm option to the repair command should do the trick. Of course
life is just not that easy.

mysql> repair table ofPubsubNodeJIDs use_frm;
+------------------+--------+----------+-----------------------------------------+
| Table            | Op     | Msg_type |
Msg_text                                |
+------------------+--------+----------+-----------------------------------------+
| ofPubsubNodeJIDs | repair | error    | Failed repairing incompatible
.frm file |
+------------------+--------+----------+-----------------------------------------+
1 row in set (0.00 sec)

Investigation shows that this indicates a need to upgrade the frm file.
So how do you upgrade the frm file? You run repair on the table and it
automatically upgrades the frm file. But wait, the repair fails so the
upgrade doesn't happen. Catch 22.

I would really rather not have to rebuild the entire openfire db from
scratch, adding about 40 user accounts with preserved passwords and so
forth.

Does anyone have ideas how I can fix this without losing data?

Thanks!

Dan


More information about the gnhlug-discuss mailing list