在mysql中,longblob和longtext的区别是什么?

时间:2022-06-17 17:00:39

What is difference between longblob and longtext in mysql?

在mysql中,longblob和longtext有什么区别?

What should I use to save a long topic ?

我应该用什么来保存一个长主题?

3 个解决方案

#1


19  

BLOBs are for Binary Large Objects. If you're storing binary data in your DB, then BLOB would be the table type you want. Otherwise.. longtext.

blob是用于二进制大型对象的。如果要在DB中存储二进制数据,那么BLOB应该是您想要的表类型。否则. .量变。

In your case longtext.

在你的情况中量变。

#2


12  

BLOB and TEXT are basically identical, except that TEXT fields have character set translation rules applied. BLOB fields do not. So with BLOB what you put in is what you get. With TEXT, what you put may not be what you get out.

BLOB和文本基本上是相同的,除了文本字段应用了字符集翻译规则。BLOB字段不。对于BLOB,你输入的就是你得到的。对于文本,你输入的内容可能不是你输出的内容。

#3


4  

You can use collation & character sets on TEXT columns, which would mean that:

您可以在文本列上使用排序和字符集,这意味着:

  1. If you specify a different charset for a connection than the TEXT column is (for instance,latin1 column, utf-8 requested), MySQL will convert the contents to the required charset.
  2. 如果您为一个连接指定一个不同于文本列的字符集(例如,latin1列,utf-8请求),MySQL将把内容转换为所需的字符集。
  3. You can sort & compare TEXT columns based on collation.
  4. 您可以根据排序和比较文本列。

BLOB's are just 'binary sequences', and you'll get them 'as is'.

BLOB是“二进制序列”,你会得到“原样”。

#1


19  

BLOBs are for Binary Large Objects. If you're storing binary data in your DB, then BLOB would be the table type you want. Otherwise.. longtext.

blob是用于二进制大型对象的。如果要在DB中存储二进制数据,那么BLOB应该是您想要的表类型。否则. .量变。

In your case longtext.

在你的情况中量变。

#2


12  

BLOB and TEXT are basically identical, except that TEXT fields have character set translation rules applied. BLOB fields do not. So with BLOB what you put in is what you get. With TEXT, what you put may not be what you get out.

BLOB和文本基本上是相同的,除了文本字段应用了字符集翻译规则。BLOB字段不。对于BLOB,你输入的就是你得到的。对于文本,你输入的内容可能不是你输出的内容。

#3


4  

You can use collation & character sets on TEXT columns, which would mean that:

您可以在文本列上使用排序和字符集,这意味着:

  1. If you specify a different charset for a connection than the TEXT column is (for instance,latin1 column, utf-8 requested), MySQL will convert the contents to the required charset.
  2. 如果您为一个连接指定一个不同于文本列的字符集(例如,latin1列,utf-8请求),MySQL将把内容转换为所需的字符集。
  3. You can sort & compare TEXT columns based on collation.
  4. 您可以根据排序和比较文本列。

BLOB's are just 'binary sequences', and you'll get them 'as is'.

BLOB是“二进制序列”,你会得到“原样”。