如何在MySQL中将BLOB转换为VARCHAR? [英] How do I convert BLOB into VARCHAR in MySQL?

查看:1144
本文介绍了如何在MySQL中将BLOB转换为VARCHAR?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它在共享主机中,并且我可以通过Navicat进行访问.我有BLOB的字段,我想将其转换为VARCHAR.我已经在设计屏幕中尝试过,但是一切都丢失了.我备份了.

It is in a shared host and I access with Navicat. I have field with BLOB and I want to convert it into VARCHAR. I've tried in the design screen but everything was lost. I backed up.

推荐答案

尝试使用它,我在一段时间前发现它,可以将其转换为char,而不是Varchar2Varchar,没有测试一下.试试:

try using this, I found it some time ago, you can convert it to char, not to Varchar2 or Varchar, haven't test it yet. Try:

CAST(a.ar_options AS CHAR(10000) CHARACTER SET utf8)

MySQL对待数据的唯一性.因此,Blob和Text之间存在差异.文本只是表示以原始形式存储的文本字符串,而不是以二进制形式存储,而blob是以二进制形式存储的文本字符串.

MySQL treat data unique. Hence there is a difference between Blob and Text. Text simply means a text string stored as original, not in binary, whereas a blob is a text string stored as a binary.

这篇关于如何在MySQL中将BLOB转换为VARCHAR?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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