Crashed WordPress MySQL Tables

On Wednesday, March 12, 2008, in Technology, by Peter Glaeser

Today I received a couple of my emails telling me that all posts of this blog were deleted. At first I thought people were kidding but then I got really scared. At first I thought somebody had hacked into my WordPress. But I always update all my blogs on the same day a new WordPress version comes out.

It turned out that the MySQL table containing the posts crashed. The MySQL log told me that by post table “is marked as crashed and should be repaired”. Great! But a little bit of research solved the problem. You need to go to the corresponding MySQL database directory, for example /var/lib/mysql/wordpress, and execute the following commands as root:

/etc/init.d/mysql stop
myisamchk -r wp_posts.MYI
/etc/init.d/mysql start

Problem solved within a few seconds. If that hadn’t worked I would have used my backups that are created hourly. Let me know if I should write something about backup strategies for standard root servers too.

Tagged with:  

One Response to Crashed WordPress MySQL Tables

  1. Carsten says:

    Yes, that’s allays interesting to know how other webmasters do their backups. Do you run a cronjob starting a MySQL-Dump or do you have a special script?

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>