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

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

问题描述

对不起,菜鸟问题,但圆圈按钮是什么意思,我如何查看 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:

+ 选项

幸运的是,您的屏幕截图已经在顶部图像的顶部显示了 + 选项.

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:

打印视图(带全文)

位于页面底部.

遗憾的是,如果您总是想显示 blob,这两种技术都无济于事,因为它似乎经常重置.您可以通过添加行来解决此问题

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 的大部分用途是在数据库中存储数字文件.此按钮允许您将新文件上传到数据库中.如果您选择一个文件并单击go",它会尝试为您将该文件的内容填充到 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 摘要"时,我看到 blob 大小最大为 55 个字节.您的示例具有更大的值,因为看起来您正在存储非常小的文本文件,我认为这意味着文本段落.如果大小大于 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天全站免登陆