Search code examples
mysqlnvarchartypes

A ideal data type for long utf8 strings in mysql


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.


Solution

  • 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.