The TO_BASE64() function was introduced in MariaDB 10.0.5.
TO_BASE64(str)
Converts the string argument str
to its base-64 encoded form, returning the result as a character string in the connection character set and collation.
The argument str
will be converted to string first if it is not a string. A NULL argument will return a NULL result.
The reverse function, FROM_BASE64(), decodes an encoded base-64 string.
There are a numerous different methods to base-64 encode a string. The following are used by MariaDB and MySQL:
SELECT TO_BASE64('Maria'); +--------------------+ | TO_BASE64('Maria') | +--------------------+ | TWFyaWE= | +--------------------+
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/to_base64/