MySQL中的BLOB和TEXT数据类型之间有什么区别? [英] What are the differences between the BLOB and TEXT datatypes in MySQL?

查看:1117
本文介绍了MySQL中的BLOB和TEXT数据类型之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是 blob ,什么是 text ?有什么区别?



什么时候需要使用 blob ,什么时候需要 text 作为数据类型?



因为 blob > text ,有 mediumblob == mediumtext smallblob == 小文本



看看这个 MEDIUMBLOB MEDIUMTEXT L + 3字节,其中 L <



什么是 L


<

TEXT和CHAR将转换为/从与时间相关的字符集。 BLOB和BINARY只存储字节。



BLOB用于存储二进制数据,而Text用于存储大字符串。



BLOB值被视为二进制字符串(字节字符串)。它们没有字符集,并且排序和比较基于列值中的字节的数值。



TEXT值被视为非二进制字符串(字符串)。它们有一个字符集,并根据字符集的排序规则对值进行排序和比较。



http://dev.mysql.com/doc/refman/5.0/en/blob.html


What is blob and what is text? What are the differences?

When do I need to use blob and when do I need text as data type?

Because for blob and text, there are mediumblob == mediumtext, smallblob == small text. Do they even have the same meaning?

And look at this MEDIUMBLOB, MEDIUMTEXT L + 3 bytes, where L < 224.

What is L?

解决方案

TEXT and CHAR will convert to/from the character set they have associated with time. BLOB and BINARY simply store bytes.

BLOB is used for storing binary data while Text is used to store large string.

BLOB values are treated as binary strings (byte strings). They have no character set, and sorting and comparison are based on the numeric values of the bytes in column values.

TEXT values are treated as nonbinary strings (character strings). They have a character set, and values are sorted and compared based on the collation of the character set.

http://dev.mysql.com/doc/refman/5.0/en/blob.html

这篇关于MySQL中的BLOB和TEXT数据类型之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆