Friday, February 29, 2008

mySQL query error: SELECT DISTINCT(ibf_posts.author_id), ibf

Hi,

Error :
------------------------------------------------------
mySQL query error: SELECT DISTINCT(ibf_posts.author_id), ibf_topics.* FROM ibf_topics
LEFT JOIN ibf_posts ON
(ibf_topics.tid=ibf_posts.topic_id AND ibf_posts.author_id=2)
WHERE ibf_topics.forum_id=4
and ibf_topics.approved=1
and (ibf_topics.pinned=1 or ibf_topics.last_post > 0) ORDER BY pinned DESC, last_post DESC LIMIT 0,50

mySQL error: Can't open file: 'ibf_posts.MYI'. (errno: 145)
mySQL error code:
Date: Thursday 28th of January 2004 03:30:26 AM
----------------------------------------------------

Solution :

This error is caused by a table corruption in your database. To correct this error, you can run the following SQL query in your shell(command : mysql databasename) or phpMyAdmin:

REPAIR TABLE ibf_posts;

I would also recommend to upgrade the version of mySQL to 4.0.15+, as the developers say they have fixed this frequent table corruption bug.

This doesn't mean that your database is failsafe if you upgrade though, as table corruptions can happen at any time. It is always recommended to backup your board files and database often.

For a great script to make mySQL backup / restore easy, check out Wraith's mySQL Backup / Restore Tool.

No comments: