Maxlength for MySQL TEXT field types
MySQL supports four TEXT field types (TINYTEXT, TEXT, MEDIUMTEXT and LONGTEXT)
MyISAM tables in MySQL have a maximum row size 65,535 bytes and all the data in a row must fit within that limit.
Luckily however TEXT field types are stored outside of the table itself and thus only contribute 9 – 12 bytes towards that limit.
Further reading is here.
Because TEXT data types are able to store so much more data than VARCHAR and CHAR field types it makes sense to use them when storing web pages or similar content in the database.
The maximum amount of data that can be stored for each data type is approximately:
TINYTEXT 256 bytes
TEXT 65,535 bytes ~64kb
MEDIUMTEXT 16,777,215 bytes ~16MB
LONGTEXT 4,294,967,295 bytes ~4GB
So most of the time TEXT will suffice, but if you are scratch building a CMS it might be an idea to think about MEDIUMTEXT
Update: (20/05/2014) – I see a lot of hits on this page, so I thought I’d spell out the information here for the terms you seem to be searching for…
TINYTEXT is a string data type that can store up to to 255 characters.
TEXT is a string data type that can store up to 65,535 characters. TEXT is commonly used for storing blocks of text such as the body of an article.
MEDIUMTEXT is a string data type with a maximum length of 16,777,215 characters. Use MEDIUMTEXT if you need to store large blocks of text, such as a book.
Maxlength for MySQL TEXT field types Read More »