views:

27

answers:

3

Hi!

Is it true that VARCHAR type in mysql only suppory 255 characters data length? if it is true what kind of datatype for UTF8 strings is useful for long texts? I'm using utf8_persian_ci datatype.

Note that TEXT datatype have problem with utf8_persian_ci.

+1  A: 

When I need to store large amounts of text, I go for a TEXT field with the utf8_general_ci collation. To be honest, I am not sure what the difference between the different uft8 encodings are, but if you need to store longer texts, go for one of the TEXT types.

Mike Caron
+1  A: 

The max length of a VARCHAR in all current versions of MySQL is 65535.

In old releases of MySQL, VARCHAR had a max length of 255, but that's ancient history (where ancient is prior to March 2005).

The CHAR data type still has a limit of 255 characters.

Bill Karwin
+2  A: 

Is it true that VARCHAR type in mysql only suppory 255 characters data length?

Not since MySQL 5.0.3, according to the documentation:

The length can be specified as a value from 0 to 255 before MySQL 5.0.3, and 0 to 65,535 in 5.0.3 and later versions.

OMG Ponies