Re: mysql lenght() and char_length not working for longer texts

From: Axel Schwenke <axel.schwenke_at_gmx.de>
Date: Mon, 6 Jul 2015 23:56:46 +0200
Message-ID: <u5ar6c-ctn.ln1_at_xl.homelinux.org>


ram_at_zedat.fu-berlin.de (Stefan Ram) wrote:

>

> But I remember that I found out that effectively varchar
> seems to be limited to about 255 characters here with
> standard settings of MySQL. I don't really understand fully why.

VARCHAR() was limited to a maximum of 255 characters (NOT bytes) in MySQL versions before 5.0.3. This is trivial to find out by RTFM:

https://dev.mysql.com/doc/refman/5.0/en/string-type-overview.html

Note that there is also a limit on the size of a row that is 65535 bytes(!). If you use a multibyte character encoding, this limits the sum of the length of all VARCHAR columns to that. The 64K row size limit does not affect BLOB and TEXT columns (since those are stored outside the row).

XL Received on Mon Jul 06 2015 - 23:56:46 CEST

Original text of this message