简体   繁体   中英

Convert blob to text in a mysql export

I'd have some blob data such as:

0x3333332c2044e963617269652c20356520e9746167650d0a53742d4c617572656e7420285175e9626563292048344e20334d390d0a

that I'd like to convert to text because the new database has text field instead of blobs and now it makes trouble with some accentuated characters.

Is there somekind of blob to string converter somewhere?

Thanks a lot!

尝试:

CONVERT(blobname USING latin1)

It depends on what the blob is. For example, I've dealt with some blobs that could be represented as basic XML files. Those would have been relatively easy to convert. However, I dealt with other blobs that were image files. If you tried to represent them as text you'd lose data.

What are in your blobs?

使用导出创建新数据库,完成后在表上创建文本列,然后使用CONVERT删除旧列进行更新,并根据需要重命名旧列。

如果使用phpmyadmin,请在导出页面底部的“以十六进制表示形式转储二进制列(例如,“ abc”变为0x616263”)框打钩。

但是,如果数据包含简单的字节流(即非结构化数据,文件,音频,视频等),并且您需要将它们表示为纯ASCII,则可以更改为Base64字符串。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM