D/ORACLE

[MySQL]TO_BASE64()

yeon.Biju 2020. 6. 11. 15:52

MySQL 문자열 함수와 연산자

 

TO_BASE64()

   -

 

TO_BASE64(str)

의 형태

 

Converts the string argument to base-64 encoded form and returns the result as a character string with the connection character set and collation. If the argument is not a string, it is converted to a string before conversion takes place. The result is NULL if the argument is NULL. Base-64 encoded strings can be docoded using the FROM_BASE64() function.

 

mysql> SELECT TO_BASE64('abc') ;
+------------------+
| TO_BASE64('abc') |
+------------------+
| YWJj             |
+------------------+
1 row in set (0.00 sec)

mysql> SELECT FROM_BASE64('YWJj') ;
+---------------------+
| FROM_BASE64('YWJj') |
+---------------------+
| abc                 |
+---------------------+
1 row in set (0.00 sec)