Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Whenever I start MySQL server 5.1.33 or 5.1.40 (developers build) and try to read from one table the server crashes with this message in log files:

InnoDB: Error: (1500) Couldn't read the MAX(userFK) autoinc value from the index (PRIMARY).

I've upgraded to 5.1.40 per but I still can't read from the table, so I cannot recover it. I've started the server with innodb_force_recovery=1 but that didn't help either, REPAIR, CHECK or SELECT or any other command just crashes the server.

How can I repair the table so that it is readable again?

share|improve this question
up vote 1 down vote accepted

I think you either need to restore from a backup or pay Oracle lots of money. Sorry.

share|improve this answer
Or use another free database that supports PostgreSQL or Firebird. Both are based on mature code, and while any database can encounter problems, I seem to keep reading the same "MySQL imploded and my web server can't get up" stories over and over again. Maybe it's a clue? – Avery Payne Oct 10 '09 at 23:39
MySQL supports transactions and usually recovers from crashes. This error was very weird. I had to drop the table and restore the backup. – HeavyWave Oct 11 '09 at 6:02
This is nothing to do with transactions. This is a corrupted data file. – David Pashley Oct 11 '09 at 7:18

take a look at innodb-tools. maybe you'll have some luck with your data.

share|improve this answer

This looks like you need to restore from your latest backup.

share|improve this answer

Depending on how the data is corrupted you may be able to select around it with a where clause. You'll likely never recover all the data from the corrupted table but you may be able to back it up row by row.

share|improve this answer

Your Answer


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.