MySQL data type: Text,,, Erroring: Data Too Long

AnApprentice picture AnApprentice · Apr 3, 2010 · Viewed 19.5k times · Source

I have a field as follows in MySQL: Type: Text Length: 0 Decimals: 0

And when I try to insert data around the size of 4 pages of MS Word, Coldfusion errors with: Data Too Long from the DB.

I thought TEXT data type was able to expand and handle this size of data? What am I missing and what can I do?

Answer

Mark Byers picture Mark Byers · Apr 3, 2010

The type TEXT is limited to 2^16 bytes, or 65536 bytes. Try using the type LONGTEXT instead. It can hold values up to 2^32 bytes in length.