gpt4 book ai didi

MYSQL:二进制和 Blob 之间的区别

转载 作者:IT老高 更新时间:2023-10-29 00:00:40 25 4
gpt4 key购买 nike

我试图理解 mysql 数据类型,但我不明白 (Var-)BINARY 数据字段和 BLOB 字段之间的区别。这些类型之间有什么区别?

最佳答案

BLOB 可以有您想要的那么大。

另外,在线阅读MySQL手册:

BLOB and TEXT differ from VARBINARY and VARCHAR in the following ways:

  • 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.

  • On comparisons, TEXT is space extended to fit the compared object, exactly like CHAR and VARCHAR.

  • 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 and TEXT columns cannot have DEFAULT values.

关于MYSQL:二进制和 Blob 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7421933/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com