base64 encode in MySQL

前端 未结 8 1270
执笔经年
执笔经年 2020-12-01 05:10

I want to select a blob col from one table, base64 encode it and insert it into another tables. Is there any way to do this without round tripping the data out of the DB and

8条回答
  •  青春惊慌失措
    2020-12-01 05:50

    SELECT `id`,`name`, TO_BASE64(content) FROM `db`.`upload`
    

    this will convert the blob value from content column to base64 string. Then you can do with this string whatever you want even insert it into another table

提交回复
热议问题