Page 1 of 1

[Solved] Is it possible to specify length of "text"

Posted: Fri Feb 24, 2006 11:49 am
by Benjamin
This is something I have always wondered. I am guessing you don't have to specify a length because the length is variable, but how do I specify a maximum length for the text data type?

Posted: Fri Feb 24, 2006 12:09 pm
by feyd
The maximum length is defined by the specific type you use.
TINYTEXT / TINYBLOB :arrow: 255 bytes.
TEXT / BLOB :arrow: 65535 bytes (64K)
MEDIUMTEXT / MEDIUMBLOB :arrow: 16,777,215 bytes (16MB)
LONGTEXT / LONGBLOB :arrow: 4,294,967,295 bytes (4GB)

http://dev.mysql.com/doc/refman/4.1/en/ ... rview.html

Posted: Fri Feb 24, 2006 12:16 pm
by Benjamin
Ok, so then I can only limit it via code then.