base64 encode in MySQL

Viewed 148449

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 through my app?

8 Answers

Looks like no, though it was requested, and there’s a UDF for it.

Edit: Or there’s… this. Ugh.

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';

Related