I've been trying to figure this out for two days now and would really appreciate some help. I've imported data from a csv where one field contained html data encoded in base64.

The idea is to loop over every row and run FROM_BASE64 on it.

How do I structure a query that:

  1. Loops over all lines
  2. Calls FROM_BASE64 for each line
  3. Runs UPDATE (or similar functionality) on that same row and column

I'm running MariaDB (MySQL equivalent).

1 Answer 1


Since you haven't given us any information about the table or column in question you'll have to update my example with the correct information.

update thetable set thecolumn = FROM_BASE64(thecolumn)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.