.: ShaolinTiger – Kung-Fu Geekery :.

WordPress Back To Default Install State – wp_options Table Corrupted

If you read my blog every day or so you may have noticed a couple of times in the past week or so it just showed the default WordPress installation screen.

Wordpress Install

Some people seem to think they've been hacked when they see this screen as it indicates the database is totally gone. The most common cause for this however is that the WordPress table wp_options has crashed or become corrupted and needs repairing.

If you have logging and access to the server you should see something like this:

./loginname_blog/wp_options' is marked as crashed and should be repaired

I have a simple control panel for my blog (DirectAdmin), most hosting will offer you something like this or something more complex like CPanel. You can find out what is corrupted by pressing the 'Check' button, if you just wish to go ahead and fix the problem use the 'Repair' option.

Repair Database

After the database is successfully repaired you should see something like this:

Repaired Database

A similar operation can be done with MySQL via command line or via PHPMyAdmin quite easily.

Now this is all well and good, but it doesn't fix the source of the problem. You can't keep repairing every time your database crashes, it started happening to me almost daily.

From my research, it seems that having too many records in the wp_options table can cause things to get funky and make it likely to become corrupted. Mine had a staggering 6234 records, a 'normal' wp_options table should have about 500 maximum.

Now what I didn't realise that was every time I installed or tested a new plugin, it left a bunch of records in the wp_options table and when I removed it...it didn't remove the records.

So I had all kinds of junk in there from the past 4 years of upgrades and experiments plus a whole lot of RSS hashes (which you can get rid of too).

My recommended solution is to use Clean Options, which is a plugin for WordPress that allows you to clean up your wp_options file.

Wordpress Clean Options Plugin

Just PLEASE PLEASE do some research and use it very carefully because it can destroy your install, I recommend that you backup your database before you start fiddling even if you're very sure what you're doing.

Before you delete anything do use the Google option and check out what created it, remember if you're using WordPress 2.8 there are transient entries that are not orphaned they are part of the new WordPress DB structure.

If you find anything from a plugin you no longer use you can safely delete it, you can ditch all the RSS hash entries. You have a far cleaner wp_options table after that!

I managed to take mine down to 234 rows, it's back up now due to the rss_hash entries but other than that it's pretty clean and slick and hasn't crashed since I've done the tidy up.

Post to Twitter Post to Yahoo Buzz Post to Delicious Post to Ping.fm Post to StumbleUpon

  

Tags: , , , , , , , , , , , , , , , , ,

Follow @ShaolinTiger on Twitter Follow me on Twitter Follow @ShaolinTiger on Twitter Subscribe to RSS Subscribe to RSS Subscribe to RSS

Posted in Internet & Tech | 8 comments -

Related Posts:
- Converting bBlog 0.76 to WordPress 2.0 (Import/Export) Script
- How to use RSS Feeds on your WordPress Site
- What Religion Are You?
- A small change to WordPress to make WHOIS International
- So here we are, New Look for 2006! Happy New Year
- I am a Pundit blogger..

8 Comments so far

  1. Chriso  on June 18th, 2009 at 12:54 pm
    Using Mozilla Firefox Mozilla Firefox 3.0.11 on Windows Windows 7 

    awesome plugin. on an unrelated note i wish there were revision management for themeing, i just lost my style.css which contains a lot of revision from the original, and here i am staring at my screen wondering what to do...

  2. Michael Yip  on June 18th, 2009 at 1:16 pm
    Using Mozilla Firefox Mozilla Firefox 3.0.11 on Windows Windows Vista 

    thanks for the heads-up regarding this issue.

  3. KY  on June 18th, 2009 at 1:40 pm
    Using Mozilla Firefox Mozilla Firefox 3.0.11 on Windows Windows XP 

    oOo, and Wp 2.8 is out!

  4. ShaolinTiger  on June 18th, 2009 at 5:39 pm
    Using Mozilla Firefox Mozilla Firefox 3.0.10 on Windows Windows Vista 

    Chriso: Haha, that one is your file management leh, I never overwrite the original file when editing. And you must have one copy either on the server or on your PC.

    Michael Yip: No worries, hope you don't encounter it :)

    KY: Yah, no major changes loh.

  5. Chriso  on June 19th, 2009 at 9:58 am
    Using Mozilla Firefox Mozilla Firefox 3.0.11 on Windows Windows 7 

    situation solved. Mr Lee from IpServerOne contacted me back within 15 minutes while the staff there replied my e-mail (and this was during lunch hour) and they took me on a de-panicking ride, and within 30 minutes they got me back a copy of the file dated the night before with no charges, hassle-free.

    Amazing host, superb support, which is why I'll be bringing my business to them! :D

    (and this is all thanks to u for introducing him :P )

  6. ShaolinTiger  on June 19th, 2009 at 3:10 pm
    Using Mozilla Firefox Mozilla Firefox 3.0.11 on Windows Windows Vista 

    Chriso: And that's why I ALWAYS recommend IPServerOne, their support is insane.

  7. Teddy  on June 23rd, 2009 at 2:53 pm
    Using Mozilla Firefox Mozilla Firefox 3.0.11 on Windows Windows Vista 

    Hmmmm, regarding that issue, have you tried optimizing the table? It might help, but yeap, a thorough fix will be using the plugin. But do proceed with caution. I'm glad that it fixed the problem for you.

    My initial diagnosis will be a disconnected database - there were a few instances in the past when the database got disconnected and my WP blog greets everyone happily with an installation page.

    p/s: Glad that Chris found his style.css! It was a harrowing experience indeed.

  8. ShaolinTiger  on June 29th, 2009 at 5:34 pm
    Using Mozilla Firefox Mozilla Firefox 3.0.11 on Windows Windows Vista 

    Teddy: Yah I did, I did both - clear out and optimize. It hasn't corrupted again since then so I hope it should be ok.

Leave a reply


Stalk Me

  • Follow Me on Twitter!
  • Users Online

    Sponsor

    Recent Comments

    Top Commentators

    Topics

    Blog Stuff


  • Other Links

    Powered By

  • Linux
  • Apache
  • PHP
  • MySQL
  • Get Firefox!
  • WordPress is a state-of-the-art semantic personal publishing platform
  • FileZilla
  • Free Source Code Editor!
  • Photoshop CS2