我可以在 MySQL 的 BLOB 列中放入的最大数据长度是多少?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5775571/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the maximum length of data I can put in a BLOB column in MySQL?
提问by Newy
What is the maximum length of data I can put in a BLOB column in MySQL?
我可以在 MySQL 的 BLOB 列中放入的最大数据长度是多少?
回答by WhiteFang34
A BLOB
can be 65535 bytes (64 KB) maximum.
A 最大BLOB
可以是 65535 字节 (64 KB)。
If you need more consider using:
如果您需要更多考虑使用:
a
MEDIUMBLOB
for 16777215 bytes (16 MB)a
LONGBLOB
for 4294967295 bytes (4 GB).
a
MEDIUMBLOB
表示 16777215 字节 (16 MB)a
LONGBLOB
表示 4294967295 字节 (4 GB)。
See Storage Requirements for String Typesfor more info.
有关详细信息,请参阅字符串类型的存储要求。
回答by Tieson T.
May or may not be accurate, but according to this site: http://www.htmlite.com/mysql003.php.
可能准确,也可能不准确,但根据此站点:http: //www.htmlite.com/mysql003.php。
BLOB A string with a maximum length of 65535 characters.
BLOB 最大长度为 65535 个字符的字符串。
The MySQL manual says:
MySQL手册说:
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
BLOB 或 TEXT 对象的最大大小由其类型决定,但您实际可以在客户端和服务器之间传输的最大值取决于可用内存量和通信缓冲区的大小
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
我认为第一个站点根据http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html从解释 MySQL 手册中得到他们的答案
回答by Shantanu Bansal
A BLOB can be 65535 bytes maximum. If you need more consider using a MEDIUMBLOB for 16777215 bytes or a LONGBLOB for 4294967295 bytes.
一个 BLOB 最多可以是 65535 个字节。如果您需要更多考虑使用 16777215 字节的 MEDIUMBLOB 或 4294967295 字节的 LONGBLOB。
Hope, it will help you.
希望,它会帮助你。