The differences between BLOB and TEXT

本文详细介绍了数据库中BLOB与TEXT类型的特性及其差异。BLOB类型包括TINYBLOB、BLOB、MEDIUMBLOB及LONGBLOB,用于存储二进制大数据对象;TEXT类型则包括TINYTEXT、TEXT、MEDIUMTEXT及LONGTEXT,主要用于存储文本数据。两种类型的最大区别在于BLOB不支持字符集而TEXT类型支持。此外,文章还提供了每种类型能存储的最大数据长度。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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)

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值