TINYBLOB is one of MySQL’s four BLOB (Binary Large Object) data types. It can hold up to 255 bytes (2^8−1) of raw binary data, making it ideal for very small files, encryption keys, UUIDs, hash outputs, and other compact binary payloads. Like all BLOB types, TINYBLOB is stored outside the table row if it does not fit the row’s static size limit; the column itself only holds a 1-byte length prefix and a pointer to the data. TINYBLOB is case-sensitive, is not automatically character-set converted, and participates in comparisons byte by byte. Indexing is possible but must specify a prefix length because full-length keys cannot exceed MySQL’s index size limits. Conversions to and from other BLOB types are implicit when size allows, but attempting to store more than 255 bytes raises a truncation error unless SQL mode permits silent truncation.
MySQL 3.23
TINYBLOB stores up to 255 bytes. If you try to insert more, MySQL raises a truncation error unless the SQL mode allows silent truncation.
Use TINYBLOB when you need a LOB that may be stored off-row and you prefer LOB semantics. Use VARBINARY when you want the data inline and know the maximum length at design time.
Technically yes, but you must define a prefix length (e.g., `PRIMARY KEY (hash(16))`). Doing so is rare; consider using a fixed-length binary column instead.
Use `SELECT CONVERT(tinyblob_col USING utf8mb4);` or `HEX(tinyblob_col)` if the data is truly binary and not encoded text.