Corrupt WordPress Database

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.

Read More

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!?

Related posts

Leave a Reply

1 comment

  1. 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.