LONGBLOB is one of four Binary Large Object (BLOB) types available in MySQL (TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB). It holds variable-length binary data such as images, audio, video, compressed files, or application-specific binary formats. A single LONGBLOB column can contain up to 4 GB minus 1 byte, making it the largest binary container in MySQL.The column stores raw bytes and performs no character-set conversion. Unlike TEXT types, BLOB types—including LONGBLOB—are compared byte by byte unless a binary collation is overridden with CAST() to CHAR(). When using InnoDB, large LONGBLOB values are stored off-page with only a 20-byte pointer kept in the main row, improving row performance but increasing I/O on access.Because LONGBLOB can exceed the default max_allowed_packet and memory limits, you must tune server parameters for inserts, updates, and replication. Indexing a LONGBLOB directly is impossible; however, you can index a prefix of up to 65,535 bytes, though smaller prefixes (often 255 bytes) are typical for performance reasons. LONGBLOB cannot have a default value other than NULL, and most client libraries stream the value to avoid loading the entire field into memory.
BLOB, TINYBLOB, MEDIUMBLOB, LONGTEXT, VARBINARY, BYTEA, LOB
MySQL 3.23
A LONGBLOB can store up to 4,294,967,295 bytes, which is effectively 4GB.
Larger objects mean more disk I/O and network transfer, so accessing LONGBLOB values can be slower. For objects under 16MB, prefer MEDIUMBLOB or smaller.
No. MySQL only allows NULL or no default for BLOB types, including LONGBLOB.
Increase max_allowed_packet and, if using replication, sync_binlog and slave_max_allowed_packet to accommodate the largest expected object size.