How to fix a corrupted WordPress comments table

I logged into my WordPress admin panel and saw these ominous warnings:

'./your_wordpress_database/wp_comments' is marked as crashed and should be repaired.

Uh oh. That doesn’t seem good. I went to one of my blog posts and it said the same thing. OK no need to panic. I run my own WordPress on a virtual private server and also administer my own MySQL databases.

The solution is remarkably simple:

  1. Run the mysql client. mysql -u your_wordpress_user -p
  2. Switch to your WordPress database. use your_wordpress_database
  3. Issue the command repair table wp_comments

September 23, 2008. Blogging. No Comments.

If your Wordpress 2.1 is slow…

I just debugged a strange issue with this Wordpress 2.1 blog. It’s running 2.1.2 to be exact, but I think the problem manifests itself with all 2.1.x versions. My site was running really slow - 40-50 seconds per page load. I had just moved it to this new host which is also running a few Rails apps. The Rails apps were running *fast*, so it wasn’t the box.

I checked top and it showed the box was fine. I bounced Apache and MySQL. Still slow. I tried static pages - those were fine. I tried a phpinfo page - that was fine.

I googled and googled and finally found this Wordpress thread: [resolved] Update a post and blam.. every pageload is 20 seconds. The solution? I had to add www.luisdelarosa.com to the /etc/hosts file. I guess WP 2.1 has some sort of reverse DNS code in it.

So - if your Wordpress 2.1 site is slow, add your blog’s hostname to the /etc/hosts file. You could also backtrack to Wordpress 2.0.1. I’ll have to look into moving over to Mephisto sometime.

April 6, 2007. Blogging. 5 Comments.

Back from a blogging vacation

I’m still here… Just been taking a vacation from this blog. Sorry to be a dinosaur in your NetNewsWire or other RSS reader. More details soon. :)

August 24, 2006. Blogging. No Comments.

Poor Man’s FeedBurner

I wanted to get an idea of how many subscribers I had to my new blog MacHappy. It’s a blog I started to talk about Mac stuff and also the Mac apps I’m writing which I call Happy Apps.

I thought about using FeedBurner, but I really like hosting my own feeds. Plus I haven’t had the need for their wide array of services yet…except for the readership count.

So back to figuring out how many subscribers / readers for a blog. MacHappy is on Wordpress and its feed is at http://www.happyapps.com/blog/feed/, which means that the feeds all have “/blog/feed” in the URL. If you’re got a Wordpress blog, you’ll have the same sort of setup. This blog is hosted on Movable Type, which is a bit different since usually you have atom.xml or whatever you call your feed template (usually ending in .xml). I’ve actually got two feeds here: a feed for everything and a feed just for Eclipse.

Then you download your log file from your ISP.

Then run this nice series of piped commands (for Wordpress): grep /blog/feed yourLogFile | awk ‘{print $1}’ | sort | uniq | wc -l

(for Movable Type): grep .xml yourLogFile | awk ‘{print $1}’ | sort | uniq | wc -l

And for my eclipse.rss feed, something like grep .rss yourLogFile | awk ‘{print $1}’ | sort | uniq | wc -l

You should get a nice integer back, hopefully a nice big one. :)

It’s not exact since the same person could be checking from multiple locations throughout the day, but I think I’ll be using this to keep track of the trend.

December 1, 2005. Blogging. No Comments.