The differences between BLOB and TEXT

来源:互联网 发布:2017东欧旅游市场数据 编辑:程序博客网 时间:2024/05/12 10:39

A BLOB is a binary large object that can hold a variable amount of data. The four BLOB types are TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB. These differ only in the maximum length of the values they can hold. The four TEXT types are TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT. These correspond to the four BLOB types and have the same maximum lengths and storage requirements.

BLOB doesn't have a character set, but TEXT has.

Keeping in mind the caveats above about max packet size and RAM, here are the sizes of each of the text types:
TINYBLOB, TINYTEXT:
2^8 or 256 bytes
BLOB, TEXT:
2^16 or 65536 bytes (64 kiB)
MEDIUMBLOB, MEDIUMTEXT:
2^24 or 16777216 bytes (16 MiB)
LONGBLOB, LONGTEXT:
2^32 or 4294967296 bytes (4 GiB)

 

原创粉丝点击