MySQL CLOB Tools - Import, Export, View and Edit

MySQL doesn’t have a native CLOB (Character Large Object) data type exactly like some other databases such as Oracle. MySQL offers the TEXT family of data types, which can be considered similar to CLOB. The LONGTEXT type can store up to 4GB of text data. More: MySQL TEXT (CLOB).

MySQL CLOB - type family and size limits

Type in MySQL / MariaDBMaximum size
TINYTEXT255 bytes
TEXT64 KB
MEDIUMTEXT16 MB
LONGTEXT4 GB

CLOB versus BLOB in MySQL / MariaDB

MySQL has no type called CLOB - the TEXT family takes its place. Both measure length in bytes, but TEXT is decoded with the column character set and takes part in sorting and comparison, while BLOB is treated as opaque binary.

What limits you first

The ceiling you actually hit is not the 4 GB column limit but max_allowed_packet (4 MB by default on MySQL 5.7, 64 MB on 8.0). A single value larger than that fails at the protocol layer.

CLOB from the command line

Things that bite with CLOB in MySQL / MariaDB