MYSQL:Binary和Blob之间的区别 [英] MYSQL: Difference between Binary and Blob
问题描述
我试图了解mysql数据类型,但我没有(Var-)BINARY数据字段和BLOB-Fields之间的区别.这些类型之间有什么区别?
I'm trying to understand mysql data types, but i don't get the difference between the (Var-)BINARY data fields and the BLOB-Fields. What ist the difference between these types?
推荐答案
BLOB可以随心所欲.
BLOB's can be as big as you want.
另外,在线阅读MySQL手册:
Also, reading the MySQL manual online:
BLOB和TEXT在以下方面不同于VARBINARY和VARCHAR:
BLOB and TEXT differ from VARBINARY and VARCHAR in the following ways:
-
当BLOB和TEXT列没有尾随空格删除时, 值被存储或检索.在MySQL 5.0.3之前,这与 VARBINARY和VARCHAR,在删除时会删除尾随空格 值将被存储.
There is no trailing-space removal for BLOB and TEXT columns when values are stored or retrieved. Before MySQL 5.0.3, this differs from VARBINARY and VARCHAR, for which trailing spaces are removed when values are stored.
在比较中,TEXT是扩展空间以适合比较对象, 完全像CHAR和VARCHAR.
On comparisons, TEXT is space extended to fit the compared object, exactly like CHAR and VARCHAR.
对于BLOB和TEXT列上的索引,必须指定索引前缀 长度.对于CHAR和VARCHAR,前缀长度是可选的.见章节 7.5.1,列索引".
For indexes on BLOB and TEXT columns, you must specify an index prefix length. For CHAR and VARCHAR, a prefix length is optional. See Section 7.5.1, "Column Indexes".
BLOB和TEXT列不能具有DEFAULT值.
BLOB and TEXT columns cannot have DEFAULT values.
这篇关于MYSQL:Binary和Blob之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!