TEXT & BLOB Type Storage Requirements in MySQL

Under “Storage Requirements for String Types in MyISAM”, there’s a table stating that BLOB and TEXT require L + 2 bytes of storage space,
where L “represents the actual length in bytes of a given string value”, and, according to the table, is less than 2^16 (65,536) [64 KBs].
Consequently, you can’t store more than that. MEDIUMTEXT will give you 16,777,215 bytes of storage, while LONGTEXT gives you just short of 4.3 billion bytes.

Different Maximum sizes for Text & Blob Type in My SQL are:

[TEXT TYPE]

TINYTEXT – 255 bytes
TEXT – 65535 bytes [64KBs]
MEDIUMTEXT – 16,777,215 bytes (2^24 – 1) [16MBs]
LONGTEXT – 4G bytes (2^32 – 1)

[BLOB TYPE]

TINYBLOB – 255 bytes
BLOB – 65535 bytes [64KBs]
MEDIUMBLOB – 16,777,215 bytes (2^24 – 1) [16MBs]
LONGBLOB – 4G bytes (2^32 – 1)

[Reference Link: http://dev.mysql.com/doc/refman/5.1/en/storage-requirements.html]

Unknown's avatar

Author: Makarand Thengdi

Director of Engineering, DevOps, and Releases at LeadSquared, with over a decade of experience in leading engineering and DevOps transformations for high-growth companies. Passionate about optimizing software delivery pipelines, cloud infrastructure, and security compliance. In this blog, I share my learnings and insights on DevOps, cloud technologies, and modern software engineering, reflecting my journey from code to cloud.

Have something to say ?

This site uses Akismet to reduce spam. Learn how your comment data is processed.