1 (edited by w0ei 2010-08-30 09:27)

Topic: Error: Incorrect key file for table 'users' after upgrade to MySQL 5.1

After upgrading from MySQL 5.0.x to 5.1.50 I have the following problem: Incorrect key file for table 'users'; try to repair it (Errno: 1034).

After Googling a bit I found out to run "REPAIR TABLE users" from the command line. However, this doesn't work:

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

Any ideas?

2

Re: Error: Incorrect key file for table 'users' after upgrade to MySQL 5.1

Nobody? sad

Re: Error: Incorrect key file for table 'users' after upgrade to MySQL 5.1

Is this your own server? Or are you paying a host (and support) ?
Let us know when and if you get it sorted.

4 (edited by w0ei 2010-09-02 12:35)

Re: Error: Incorrect key file for table 'users' after upgrade to MySQL 5.1

Yes it's on my own (VPS) server.

And it happened after upgrading MySQL. Of course I realize that I can downgrade again but that's not the solution imo, since all the other PHP/MySQL scripts still work fine smile (and downgrading can give new problems of course).

5

Re: Error: Incorrect key file for table 'users' after upgrade to MySQL 5.1

According to this discussion this code could work...

[code=sql]REPAIR TABLE tablename USE_FRM;[/code]

Eraversum - scifi browser-based online webgame

6 (edited by w0ei 2010-09-02 15:39)

Re: Error: Incorrect key file for table 'users' after upgrade to MySQL 5.1

It should but it doesn't sad

mysql> REPAIR TABLE users USE_FRM;
+-------+--------+----------+-----------------------------------------+
| Table | Op     | Msg_type | Msg_text                                |
+-------+--------+----------+-----------------------------------------+
| users | repair | error    | Failed repairing incompatible .frm file |
+-------+--------+----------+-----------------------------------------+
1 row in set (0.00 sec)

From: http://dev.mysql.com/doc/refman/5.1/en/ … table.html

As of MySQL 5.1.25, if you use USE_FRM for a table that was created by a different version of the MySQL server than the one you are currently running, REPAIR TABLE will not attempt to repair the table. In this case, the result set returned by REPAIR TABLE contains a line with a Msg_type value of error and a Msg_text value of Failed repairing incompatible .FRM file.