Moving at the Speed of Creativity by Wesley Fryer

WordPress commenting restored thanks to phpMyAdmin table repair

A moment for joy and thanksgiving has arrived, in a very geeky sense– I was able to FIX the mySQL error which was causing comments to not work on my WordPress blog! I wrote about this last Wednesday in a “plea for help” post. Last week as I spent some time googling for answers, I came across a post (similar to this one) which explained how WordPress mySQL databases over time can develop “overhead” and need to be repaired using phpMyAdmin. This is similar to defragmenting a hard drive, evidently. It is apparently natural for “overhead” to develop, and just a part of “normal” maintenance to repair/remove it periodically.

As I wrote about in my post last week, the problem I was having when people tried to leave comments on my blog they could not and were presented with a generic 404 (page not found) error. As I looked into this, I noticed that in my WordPress dashboard it showed I did not have ANY comments in my blog, even though there should be a bunch. mySQL showed the table records for comments were there in the wp_comments table, but the dashboard did not:

Wordpress comment mySQL error

Now that I’ve finished this repair, comments again show up numbered correctly in my WordPress dashboard:

Comment count in WordPress dashboard back to normal

I referred to my error log for my site and found that there was a duplicate comment number, which was causing the problem. When I tried to delete the offending table row, however, a “key field” error was reported. I was stumped.

Search for mySQL error in phpMyAdmin

Incorrect key field for table

The solution, it turns out, was using the “repair” option in phpMyAdmin. To do this, when you select your database in phpMyAdmin select the tables which have overhead shown in the last column. Then at the bottom, choose “repair table.” This is the course of action suggested my phpMyAdmin, but since I had never done this or encountered this situation previously I wasn’t sure exactly how to proceed.

Reparing tables in phpMyAdmin

When I did this for my wp_comments table, my problem was fixed!

mySQL blog commenting problem fixed

The repair results show that the number of table rows was incorrect and the repair procedure fixed this. That was it!

I am overjoyed to have this problem resolved, but this situation overall has pointed out my need to do a more complete and thorough maintenance cleanup of my WordPress mySQL database. I need to go through my error logs line by line (something I definitely don’t relish) and figure out how to fix the problems which are being reported there. Possibly some of my past problems will be fixed by this overhead repair procedure, but I’m not sure. I’m considering posting a request for a quote on or similar to this one, to let a WordPress guru (in another country, most likely) working for a smaller fee take care of this for me. Outsourcing IT support needs like this makes sense and can be affordable. I might just give this a try.

For now, I’m just pleased this commenting issue has been resolved. 🙂 This situation highlights the value of people using a hosted/managed blogging solution like Edublogs,, Blogger, Typepad, etc. instead of self-hosting WordPress as I am. I’m still glad to be self-hosting, but dealing with these sorts of troubleshooting situations CAN cause some stress. Thankfully, in situations like these, we have Google. 🙂

Technorati Tags:
, , ,

If you enjoyed this post and found it useful, subscribe to Wes’ free newsletter. Check out Wes’ video tutorial library, “Playing with Media.” Information about more ways to learn with Dr. Wesley Fryer are available on

On this day..