In MySQL, the BLOB (Binary Large Object) data types are used to store large amounts of binary data, such as images, audio, and video files. More: MySQL BLOB.
| Type in MySQL / MariaDB | Maximum size |
|---|---|
TINYBLOB | 255 bytes |
BLOB | 64 KB |
MEDIUMBLOB | 16 MB |
LONGBLOB | 4 GB |
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.
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.
mysqldump (writes BLOBs as hex by default) or SELECT ... INTO DUMPFILELOAD_FILE() - restricted by secure_file_priv - or mysqlimportmax_allowed_packet at its default and the 4 GB LONGBLOB ceiling is unreachablecol(255)mysqldump writes BLOB values as hex literals, so the dump is about twice the size of the data; --hex-blob just makes that explicitROW_FORMAT=COMPACT or REDUNDANT only 768 bytes stay in the row