在phpMyAdmin中查看Blob的内容 [英] Viewing Content Of Blob In phpMyAdmin

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

问题描述

很抱歉Noob问题,但是带圆圈的按钮是什么意思,如何查看Blob的内容?
(来源: rigel222.com )

Sorry for the Noob Question, but what does the circled button mean, and how can I view the content of a blob?
(source: rigel222.com)

推荐答案

早期版本的phpmyadmin的设置为

earlier versions of phpmyadmin had a setting called

$cfg['ShowBlob']              = TRUE;

这将使您可以在浏览器中查看blob的内容.您应该注意,如果将二进制文件存储在blob中,这会引起混乱,因为在浏览器窗口中会看到无尽的gobblygok.有一些人(像我一样)决定他们的应用程序需要使用BLOB类型来存储文本(在当时看来,这是一个不错的决定,而正如我回忆起的那样,我对此作出了一些思考).但是,phpmyadmin决定通过弃用此配置设置来阻止这种情况.可以理解,因为这样做可能会引起很多支持请求.显然,这种想法是使人们移至TEXT字段类型上.

That would allow you to view the contents of blobs in the browser. You should note that this would cause chaos if you were storing binary files in blobs, since you would see endless gobblygok in the browser window. There are some people (like me) who decided that their application needed to use BLOB types to store text (seemed like a good decision at the time, and as I recall there was some thinking on my part that went into the decision). However phpmyadmin decided to discourage this by deprecating this config setting. Understandable since doing this might cause quite a support request. Apparently the thinking was to move people over the TEXT field types.

愉快地显示blob的内容已移至用户界面而非配置中.

Happily displaying the contents of blobs has been moved into the user interface rather than the configuration.

浏览时查看blob内容的最简单方法是单击链接:

The simplest way to see the contents of blobs when you are browsing is to click the link:

+选项

+ Options

很高兴您的屏幕截图已经在顶部图像的顶部显示了+选项.

Happily your screenshot already shows the + Options in the top part of the top image.

这将显示一个表格,该表格将允许您显示blob(和二进制文件).单击该按钮,它将把它添加到会话的选择中,以确保从那时起您可以看到其中的内容.

Which will display a form that will allow you to display blobs (and binaries). Click that and it will add it to your choice to the session, ensuring that you see the contents from then on.

您还可以使用打印视图获得相同的结果:

You can also get the same result using print view:

打印视图(全文)

Print view (with full texts)

住在页面底部.

遗憾的是,如果您始终要显示斑点,则这两种技术都无济于事,因为斑点似乎经常重置.您可以通过添加以下行来解决此问题

Sadly both of these techniques are not helpful if you always want to display the blob, since it appears to reset frequently. You can fix this by adding the line

$_GET['display_blob'] = true;

在sql.php文件的开头.我认为可能会有更好的方法,希望其他人也可以提出来……

At the beginning of the sql.php file. I think there might be a better way to do this, and I hope someone else might bring it up...

(注意:正如Rodrigo指出的,您可以通过在URL上附加&display_bob=true来手动实现此效果)

(note: as Rodrigo pointed out you can manually achieve this effect by appending &display_bob=true on the URL)

您对选择文件"按钮的特定问题很简单. Blob的大多数用途是用于在数据库中存储数字文件.使用此按钮可以将新文件上载到数据库中.如果您选择一个文件并单击开始",它将尝试为您将该文件的内容填充到Blob列中.

Your specific question about the "Choose File" button is simple. Most of the uses of blobs are for storing digital files in the database. This button allows you to upload a new file into the database. If you select a file and click "go" it will try to stuff the contents of that file into the blob column for you.

仅需注意,仅显示blob的内容可能不是其他用户想要的.当我使用此选项显示blob之前查看"blob摘要"时,我看到最大55个字节的blob大小.您的示例具有更大的值,因为看起来您正在存储非常小的文本文件,我认为这意味着文本的段落.如果大小大于10千字节,则可能是一个二进制文件,只会显示gooblegok.

Just to note, simply displaying the contents of the blob is probably not what other users want. When I look at the "blob summary" before I use this option to display the blobs I see blob sizes of 55 bytes max. Your example has bigger values, because it looks like you are storing very small text files, which I assume means paragraphs of text. If the size is bigger then 10's of kilo-bytes it is probably a binary file that will just display gooblegok.

如果您要智能下载二进制文件(而不是将它们显示为文本),我认为您需要研究phpmyadmin所谓的blobstreaming.

If you want to download binary files intelligently (rather than displaying them as text) I think you need to look into what phpmyadmin calls blobstreaming.

这篇关于在phpMyAdmin中查看Blob的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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