What is the maximum length of data I can put in a

2019-01-03 13:08发布

What is the maximum length of data I can put in a BLOB column in MySQL?

标签: mysql blob
4条回答
Ridiculous、
2楼-- · 2019-01-03 13:46

A binary large object that can hold a variable amount of binary data. The sorting and comparison of the values for these objects is performed in case-sensitive manner.

TINYBLOB

A binary large object column with a maximum length of 255 (2^8 - 1) characters.

BLOB

A binary large object column with a maximum length of 65535 (2^16 - 1) characters.

MEDIUMBLOB

A binary large object column with a maximum length of 16777215 (2^24 - 1) characters.

LONGBLOB

A binary large object column with a maximum length of 4294967295 (2^32 - 1) characters.

查看更多
祖国的老花朵
3楼-- · 2019-01-03 13:49

A BLOB can be 65535 bytes (64 KB) maximum.

If you need more consider using:

  • a MEDIUMBLOB for 16777215 bytes (16 MB)

  • a LONGBLOB for 4294967295 bytes (4 GB).

See Storage Requirements for String Types for more info.

查看更多
三岁会撩人
4楼-- · 2019-01-03 13:57

May or may not be accurate, but according to this site: http://www.htmlite.com/mysql003.php.

BLOB A string with a maximum length of 65535 characters.

The MySQL manual says:

The maximum size of a BLOB or TEXT object is determined by its type, but the largest value you actually can transmit between the client and server is determined by the amount of available memory and the size of the communications buffers

I think the first site gets their answers from interpreting the MySQL manual, per http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html

查看更多
老娘就宠你
5楼-- · 2019-01-03 13:57

A BLOB can be 65535 bytes maximum. If you need more consider using a MEDIUMBLOB for 16777215 bytes or a LONGBLOB for 4294967295 bytes.

Hope, it will help you.

查看更多
登录 后发表回答