Decode Base64 mysql

Asked

Viewed 1,791 times

1

I have a mysql database that some columns of it is encoded in Base64. I’m not familiar with programming to develop a script in another language that decodes. You can create a select in sql that decodes the specific columns?

1 answer

4

According to the documentation, there is the FROM_BASE64 function()

Example(in the documentation):

mysql> SELECT TO_BASE64('abc'), FROM_BASE64(TO_BASE64('abc'));
        -> 'JWJj', 'abc'

I didn’t know about this function, but all it took was a single google search to find the answer. I recommend you do this before asking, as it may save you time.

  • Thank you, but gave error: Error Code: 1305. FUNCTION dmail.TO_BASE64 does not exist

  • I used the very code of the example of documentation: SELECT TO_BASE64('abc'), FROM_BASE64(TO_BASE64('abc'));

  • What version of mysql you are using?

  • I’m using version 5.5.53

Browser other questions tagged

You are not signed in. Login or sign up in order to post.