Friday, November 2, 2012

MySQL: [1406]Data too long for column

If you get this 1406 error while you run SQL command to insert data into a TEXT column.

1. Check if max_allowed_packet size is enough for your SQL command size. If not, change it in the my.ini file. Just nnclude the single line under [mysqld] in your file, for example:
max_allowed_packet=16M
Then restart mysql.

2. If max_allowed_packet is OK, try to change the column to LONGTEXT.

Hope it can help some bodies -:)

No comments:

Post a Comment

Subscribe to RSS Feed Follow me on Twitter!