Avatar of Karl_mark
 asked on

Incorrect Key File for table smf_members

A messageboard on which I am an administrator has recently gone down. Although I am an administrator, I do not own the site and the owner and I have been meaning to upgrade to a later version of smf for some time but never quite got round to it! Anyway, the webhost recently dumped us on to a new version of smf as well as MYSQL which has left the site down. There seem to be a few tables with the same issue:
Incorrect Key File for Table x; try to repair it.
I've tried repairing it using the extended option but to no avail. There is a slight difference in some of the messages though:


both report Incorrect Key File error

reports :
Table upgrade required. Please do "REPAIR TABLE `smf_log_errors`" or dump/reload to fix it!

If I try to run Repair Table smf_log_errors I get:

Error Message
When looking at the structure view the tables that are corrupt show as In Use:

Structure View
The version of MYSQL is 5.0.8.

We could try rolling back to an earlier backup, but the owner has mislaid them on various hard drives which he'll need to reconnect to a pc somewhere!
MySQL Server

Avatar of undefined
Last Comment

8/22/2022 - Mon

Do you have a shell access to the server where that mysql database is located? Is it a Linux server? If so:

1. Go to the folder of the database of that table. Type grep datadir /etc/my.cnf to find it, normally it's located in /var/lib/mysql/YOUR_DATABASE_NAME
2. Type myisamchk --safe-recover TABLE_NAME

Yes I do have SSH access. I tried running myisamchk against the tables and it does say "Recovering table..." followed by "Fixing Index 1....Fixing Index 13". It doesn't report any errors. However, trying to query the table in MYSQL I get the same incorrect Key File error.

I have read elsewhere that there can be an issue when upgrading a database from 4.x.x to 5.1.x where some tables become corrupt with the incorrect key file message. Would it be useful to upgrade a copy of the 4.x database to 5.0.x and then to 5.1.x? Or would it be quicker to create a new table with the same schema as the corrupt one and then import the data before renaming it to the same as the corrupt one?

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

None of the solutions worked and we had to go with a brand new database in the end.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck