Avatar of Karl_mark
Karl_mark
 asked on

Incorrect Key File for table smf_members

Hi,
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:

smf_members
smf_boards

both report Incorrect Key File error

smf_log_errors
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
Karl_mark

8/22/2022 - Mon
sylenix

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
Karl_mark

ASKER
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?
ASKER CERTIFIED SOLUTION
Karl_mark

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
or
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
Karl_mark

ASKER
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