This site is now AnswerTips enabled. Double-click any word for its definition.

A WordPress Problem & How to Fix It

by Bill Hely on December 23, 2009 · 2 comments

WordPress-logo-brokenIt appears that quite a few readers of this blog may have been confused and inconvenienced when trying to post a comment to one of my posts.Turns out it was a bug in the WordPress software that I use for this blog.

It wasn’t until I was notified of the details by a reader that I was even aware of the problem and thus able to take steps to rectify it. Many thanks to Jeff Fine for sending me details of the problem as it appeared to him, and then testing my fix. I really appreciate it when people take the time to report their problems or share their observations.

Any readers who publish a WordPress blog might want to take note of this for future reference. I’ll provide plenty of detail so you can test for and fix this yourself, because going by my experience you won’t get much help from WordPress on this one.

NOTE: the rest of this article will only be meaningful to those with some experience of databases, particularly MySQL, and the internal workings of browsers. Anyone else just needs to know that the problem with posting comments to my articles has now been fixed.

OK, here are the details:

SYMPTOMS

The reason I wasn’t aware of this problem before being notified by Jeff is that I follow my own advice and, for very good reasons related to overall security, I use Firefox as my day-to-day browser. After testing with Firefox 3.5, Internet Explorer 8 and Google Chrome 3 it became obvious that the problem was only encountered by those using Internet Explorer.

While the actual error encountered may vary, the problem boils down to this WordPress error:

WordPress database error Data too long for column ‘comment_agent’
at row 1 for query INSERT INTO wp_comments

Or something very similar. You can use the same fix described below if a similar error refers to a different column/row.

What it amounts to is that WordPress doesn’t like the User Agent string being sent by Internet Explorer.

THE FIX

Putting it briefly, I fixed the problem by changing the MySQL data type for the field “comment_agent” from VARCHAR(255) to TEXT, which has a field size limit of 65,000 bytes.

HOW TO DO IT

If you are a Webmaster who is quite comfortable with phpMyAdmin then good for you — you already understand what needs to be done. Personally I don’t like phpMyAdmin at all, and maybe you’ll change your mind too, if you try what I use.

If you need to work with MySQL databases you really need to know about a great little application called HeidiSQL. Once you try it I doubt you’ll ever want to call up phpMyAdmin again.

I’m not going to turn this into a HeidiSQL tutorial, because you really don’t need one. Any help you may need is readily available in the website and their forum.

Oh, and by the way — HeidiSQL is completely free.

http://www.heidisql.com

HeidiSQL-1

You can enlarge these images with the
keyboard combination: Ctrl+

HeidiSQL-2

Reblog this post [with Zemanta]

Post to Twitter Post to Digg Post to Facebook Post to StumbleUpon

Leave a Comment

You can add images to your comment by clicking here.

{ 2 trackbacks }