Crashed WordPress MySQL Tables
March 12th, 2008 by Peter Glaeser |
RSS feed for comments on this post |
TrackBack URI
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.


One Response to “Crashed WordPress MySQL Tables”
By Carsten on Mar 13, 2008 | Reply
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?