Title: Solution to: &#8220;database error Data too long for column&#8221;
Last modified: August 19, 2016

---

# Solution to: “database error Data too long for column”

 *  [BillHely](https://wordpress.org/support/users/billhely/)
 * (@billhely)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/solution-to-database-error-data-too-long-for-column/)
 * I tried searching the web for a solution to this problem, and I can see a lot
   of other people are experiencing the same thing, without getting a lot of useful
   help.
 * My day-to-day browser is Firefox so I didn’t notice this earlier, but it has 
   been brought to my attention that people using Internet Explorer to comment to
   my blog receive a database error. Once I was alerted I was able to verify this
   myself. Here is an example from a test post I made:
 * _WordPress database error Data too long for column ‘comment\_agent’ at row 1 
   for query INSERT INTO `wp\_comments` (`comment\_post\_ID`,`comment\_author`,`
   comment\_author\_email`,`comment\_author\_url`,`comment\_author\_IP`,`comment\
   _date`,`comment\_date\_gmt`,`comment\_content`,`comment\_karma`,`comment\_approved`,`
   comment\_agent`,`comment\_type`,`comment\_parent`,`user\_id`) VALUES (‘1523′,’
   Bill Hely’,’Support@ComputerAndOnlineSecurity.com’,”,’121.210.198.54′,’2009-12-
   19 08:21:12′,’2009-12-18 22:21:12′,’This is a test comment.’,’0′,’0′,’Mozilla/
   4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; THN\_Toolbar; GTB6.3;
   Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; FDM; OfficeLiveConnector.
   1.4; OfficeLivePatch.1.3; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30;.
   NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)’,”,’
   0′,’0′) made by wp\_new\_comment, wp\_insert\_comment _
 * It would seem that WordPress doesn’t like the User Agent string being sent by
   Internet Explorer. As you can see my version of Internet Explorer is 8.0 (actually
   8.0.6001.18702). The User Agent string of the person who first alerted me to 
   this problem shows their version as 7.0b.
 * Both Firefox 3.5.6 and Google Chrome 3.0.195.38 allow comments normally without
   complaint.
 * Now, I have managed to circumvent this problem by changing the MySQL data type
   for comment_agent from VARCHAR(255) to TEXT, which I believe has a field size
   limit of 65,000 bytes.
 * A lot of bloggers who encounter this problem wouldn’t know how to analyse it,
   or how to implement the above fix.
 * It would be very useful to have a definitive comment from WordPress on this issue.

The topic ‘Solution to: “database error Data too long for column”’ is closed to 
new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [BillHely](https://wordpress.org/support/users/billhely/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/solution-to-database-error-data-too-long-for-column/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
