Convert blob to text in a mysql export

13,318

Solution 1

Try:

CONVERT(blobname USING latin1)

Solution 2

Create your new database with your export, once done create your text column on the table, update that using a CONVERT drop the old column, renaming the old one if required.

Solution 3

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?

Share:
13,318
Tommy B.
Author by

Tommy B.

🙋🏼‍♂️ I'm a full-time freelance developer and open-source contributor who've been building mobile, web and software solutions for the past 15 years in multiple industries including the Medical/Health Industry, Adult Industry, Social Media, SaaS, VoIP, VPN, Web Hosting, E-Commerce & Marketing, ERPs, Automobile, Metallurgy and more. 🌟 Expertise areas: PHP, NodeJS, ExpressJS, C#, Visual Basic, MySQL, PostgreSQL, SQL Server, MongoDB, REST APIs, Heroku, DigitalOcean, AWS (Lambda, EC2, S3, RDS and more), VueJS, React, Angular, Ionic, TypeScript, Bootstrap, SCSS and more. 👨‍💻 Why choose me? I'm always available and extremely responsive. That's what passion is! I focus not only on delivering value, but I also improve all the projects I touch by bringing suggestions and ideas to every client I work with. I encourage you to take a look at my work history and other related profiles. (I'm active on GitHub, StackOverflow and LinkedIn) Contact me at anytime, thanks for checking out my profile! 👋

Updated on June 04, 2022

Comments

  • Tommy B.
    Tommy B. almost 2 years

    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!