base64 encode in MySQL

前端 未结 8 1272
执笔经年
执笔经年 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:30

    create table encrypt(username varchar(20),password varbinary(200))

    insert into encrypt values('raju',aes_encrypt('kumar','key')) select *,cast(aes_decrypt(password,'key') as char(40)) from encrypt where username='raju';

提交回复
热议问题