Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

The weirdest Wordpress problem ever I think. A clients site with a large database of posts has got a mind of it's own. One minute everything seems fine, the next posts, categories and tags are missing.

At the minute the dashboard is telling me there's 2309 posts in 9 categories but when I click the categories link in admin there's none in the list.

I can see all posts in admin but whereas they used to be assigned to categories and have tags listed, they're all now "Uncategorized" with "No Tags".

Obviously the wordpress database is corrupt in some way but where to start to try fix it!?

Here's what I've tested so far:

Plugins – I turned off all current plugins. Theme – I tried a different theme/template. Wordpress Core – I re-uploaded the latest wordpress version. Updates – I updated all plugins and wordpress core. Repair Database - I checked and tried to repair the database in Cpanel but it timed out.

Help!?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

You're probably running into the joys of MySQL's MyISAM engine...

From within MySQL (or PhpMyAdmin), use REPAIR TABLE xyz statements again, repeatedly, on each of your tables (or rather, your terms related tables, since these are the ones that sound corrupt) to see if this solves anything.

If those fail, there are a few documented workarounds:

http://www.google.com/search?q=recover+a+corrupt+mysql+database

Once things are recovered, run OPTIMIZE TABLE xyz statements on each table, and then alter the engine of the database and each table to make it use InnoDB. InnoDB clutters the catalog somewhat (especially if you drop a database or large tables), but -- being ACID compliant -- it's a hell of a lot less error prone than MyISAM.

share|improve this answer
2  
and make sure to have a backup dude ! –  mireille raad Oct 22 '10 at 0:23
    
Denis, I think you might just have saved my life! That seemed to work fine..One question - Is there a quick way to convert a whole database to InnoDB? –  Leon Quinn Oct 22 '10 at 1:03
    
Not that I'm aware of. You need to ALTER each table. And if memory serves, also ALTER the database so new tables are set to innodb by default. –  Denis de Bernardy Oct 22 '10 at 1:32

Your Answer

 
discard

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.