BLOB Data Types in MySQL

BLOB means binary large object. BLOB columns store binary strings (raw bytes), which makes them suitable for binary content when keeping that content inside the database is appropriate.

CREATE TABLE document_store (
    id INT UNSIGNED NOT NULL AUTO_INCREMENT,
    file_name VARCHAR(255) NOT NULL,
    file_data LONGBLOB NOT NULL,
    PRIMARY KEY (id)
);

BLOB families

TypeMaximum length
TINYBLOB255 bytes
BLOB65,535 bytes
MEDIUMBLOB16,777,215 bytes
LONGBLOB4,294,967,295 bytes

BLOB values are compared as binary strings. The corresponding TEXT families store character strings and use character sets and collations.

Avoid selecting large BLOB columns when the application does not need them. Prefer an explicit column list instead of SELECT * for large tables.



Subscribe to our YouTube Channel here



plus2net.com




SQL Video Tutorials










✖
We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
© 2000-2026 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer