Link to home
Get AccessLog in
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:

User generated image
When looking at the structure view the tables that are corrupt show as In Use:

User generated image
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!
Avatar of sylenix
sylenix
Flag of Philippines image

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
Avatar of Karl_mark
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
Avatar of Karl_mark
Karl_mark

Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access
None of the solutions worked and we had to go with a brand new database in the end.