Decode base64 mysql

1

I have a database in mysql that some columns of it are base64 encoded. I'm not familiar with programming to develop a script in another language that does the decoding. Is it possible to create a select in sql that decodes the specific columns?

    
asked by anonymous 04.01.2017 / 18:06

1 answer

4

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

Example (in documentation):

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

I did not know the existence of this function, but a single search in google to find the answer. I recommend you do this before you ask, as it may save you time.

    
04.01.2017 / 18:23