MEDIUMBLOB is one of MySQL’s four BLOB types (TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB). It is designed for medium-sized binary payloads such as small images, compressed documents, or serialized objects that exceed 64 KB but are unlikely to surpass 16 MB. Internally MySQL prefixes each MEDIUMBLOB value with a 3-byte length field, allowing values from 0 to 16,777,215 bytes. MEDIUMBLOB data is treated as raw bytes—no character set or collation is applied—so functions that expect text will not work without conversion. The type occupies only as much storage as the data plus the 3-byte prefix. When used in an InnoDB table, MEDIUMBLOB values longer than the InnoDB page size (default 16 KB) are stored off-page, with the primary key pointing to the overflow pages. MEDIUMBLOB cannot have a default value prior to MySQL 8.0.13, cannot participate in FULLTEXT indexes, and obeys the same nullability and indexing rules as other BLOB types.
TINYBLOB, BLOB, LONGBLOB, VARBINARY, MEDIUMTEXT, LOAD_FILE, BINARY
MySQL 3.23
Most MySQL clients cannot display raw binary. Wrap the column with HEX(), BASE64_ENCODE(), or export it to a file.
Yes, but only on a prefix length. For example: `CREATE INDEX idx_img ON product_images (image(255));` Large prefixes increase index size.
No. MEDIUMBLOB is binary. Character sets and collations are ignored.
From MySQL 8.0.13 onward you can assign a literal or expression default. Earlier versions disallow defaults on BLOB types.