在MySQL中存储HTML:Blob还是文本? [英] Storing HTML in MySQL: blob or text?

查看:374
本文介绍了在MySQL中存储HTML:Blob还是文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在数据库中存储大量HTML数据.

I have to store large amount of HTML data in a database .

我已经用Google搜索了,发现了有关blob数据类型的信息,我检查了它,然后它可以正常工作.

I have Googled and found something about the blob datatype, I checked it and it is working correctly.

我需要将HTML页面存储在表中,并且需要根据需要将它们正确显示为网页.

I need to store the HTML pages in the tables and need to show them correctly as web pages on demand.

那么,这对于存储大型HTML页面(textblob)更好?

So, which is better for storing large HTML pages, text or blob?

推荐答案

我会使用blob,它是一个varbinary,并且不做任何翻译.因此,您的html会以与输入时完全相同的方式出现.

I'd use blob it's a varbinary and does not do any translation. So your html will come out exactly the same way that it went in.

如果您要搜索和索引html TEXT可能是一个更好的选择. 在这种情况下,请确保使用正确的字符集.
我建议使用UTF8.

If you want to search and index that html TEXT may be a better choice. In that case make sure you use the proper charset.
I'd recommend UTF8.

这篇关于在MySQL中存储HTML:Blob还是文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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