Repair A Crashed MySQL Table

I went through a bit of a scare with my blog today. All of a sudden I keep getting a barrage of emails informing me that my new WordPress blog had been successfully set up at Juixe TechKnow. I was like, WTF! I immediately emailed the technical support for my hosting provider but they did not know and give me any insight as to what happened to my blog. At first I thought I had been infected with a WordPress virus, or that someone at my hosting provider had inadvertently deleted my blog. As it turned out, as i dug around I discovered a ton of WordPress database errors that read like the following…

Table 'wp_options' is marked as crashed and should be repaired

As it turned out, only the WordPress options table had been corrupted and this was easy to fix simply by repairing that table.

To repair a MySQL table, log into your database using phpMydmin web client. Select you database from the database drop down on the left hand side. At this point, you should be looking at a list of all the tables in the database. Check the database table that has crashed and at the select repair table from the drop down options at the bottom of the list of tables. That should fix crashed or corrupted MySQL tables.

If you don’t have phpMyAdmin web client, you can just run the repair table command. From your MySQL query console enter the following.

REPAIR TABLE wp_posts

Technorati Tags: , , , ,

Enjoy. Share. Be Happy.
  • Twitter
  • Facebook
  • StumbleUpon
  • del.icio.us
  • Tumblr
  • Google Bookmarks
  • FriendFeed
  • Yahoo! Buzz
  • Reddit
  • Digg
  • HackerNews
  • Suggest to Techmeme via Twitter
  • LinkedIn
  • Ping.fm
  • Identi.ca
  • Mixx
  • Furl

Related posts:

  1. MySQL Optimization Tutorial
  2. MySQL Admin
  3. Show SQL Tables
  4. Desc SQL Tables
  5. SQL Server Query Shortcuts

This entry was posted in SQL, TechKnow, Tools. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

4 Comments

  1. Posted July 21, 2008 at 2:32 pm | Permalink

    Thank you for this information. My site has been down for over three days because of issues to my wp_options table. Following your instructions above I was able to get back up and running in minutes.
    Thanks,
    Brad

  2. Posted July 29, 2008 at 1:11 am | Permalink

    Hey thanks a lot for this info, I too had the same experience and now thanks to you my blog is back up.

  3. Posted April 27, 2009 at 9:17 pm | Permalink

    hi im having the same problem from time to time. would you know what’s causing the options table to crash?

  4. Posted July 22, 2009 at 3:55 pm | Permalink

    Dude, thank you so much. Yet another reason why Open Source communities are just as important as its software, and just as cool. This saved one of my projects.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*