I had a nasty surprise for me tonight when I realized none of my posts were available on my blog (the one you’re looking at now!). I could log into WordPress and see everything but my posts showed a count of zero (scary!). My first thought was to restore my latest backup only to realize my backup didn’t run this week. I did have the backup from last week so I logged into phpMyAdmin and this is where I found the actual problem. When I clicked on the wp_posts table, I received the following error:
#144 – Table ‘./wp_posts’ is marked as crashed and last (automatic?) repair failed
By no means am I a mysql expert. I’m still not sure why this even happened. However, this was actually not very difficult to correct in my case (once I found the cause and a few mysql forums) and I wanted to share the steps I went through to correct this:
1. Sign into your phpMyAdmin account
2. Click on your database name on the left
3. Then click on SQL in the tabs on the top
4. In the query box enter: repair table wp_posts and then click Go. (note: you’ll need to replace wp_posts with whatever table you are having an issue with if it’s not this table)
For me this took a little while to finish (probably less than one minute). After that, things were working well again. Obviously, this isn’t going to work in every case but if you’re lucky like I was, maybe it will. I’m still a little nervous as to why this happened in the first place but at least I now have an up-to-date backup if it happens again!