©SQL :: Manager
HomeProgram InformationTechnical detailsFree downloadDonate for a cup of coffee
myway SQL Manager for MySQL and MariaDB, Download on Uptodown
SQL functionMySQLMariaDB

The FROM_BASE64 SQL Function in MySQL and MariaDB - Decode from Base-64

FROM_BASE64Syntax:FROM_BASE64(String)
Return value:CHAR
Function type:Encryption & Compression
Function Description

The FROM_BASE64() function decodes the "String" argument from its base-64 encoded form back into a string with the current character set and collation of the connection.

If the value of "String" is an empty string, the function returns an empty string.

If the value of "String" is NULL or contains an invalid value, the TO_BASE64() function returns NULL..


The TO_BASE64() function is used to convert character strings to their Base-64 encoding.

SQL Examples for the FROM_BASE64 function

 1
 2
 3
 4
 5
 6
 7
 8
 9

select from_base64('VGVzdA==');
select from_base64('MTIzNA==');
select from_base64('MTIzNDU2');

select from_base64('');
select from_base64('xxx');
select from_base64(null);

from_base64('VGVzdA==')
varchar(6) BINARY
Test
from_base64('MTIzNA==')
varchar(6) BINARY
1234
from_base64('MTIzNDU2')
varchar(6) BINARY
123456
from_base64('')
varchar(0) BINARY
 
from_base64('xxx')
varchar(3) BINARY
NULL
from_base64(null)
varchar(0) BINARY
NULL
The examples were created with the MyWAY SQL manager: Download

How to use the FROM_BASE64() function in MySQL and MariaDB databases

MySQL and MariaDB provide a FROM_BASE64() function used to decode a Base64 encoded string and to return the original data. The function takes a Base64 encoded string as input and returns the decoded data as a binary or string value, depending on the context. The function can be used in applications where data should be transmitted or stored as text and presented in a compact format. Base64 encoding is commonly used to encode binary data such as images or files for transmission over text-based protocols or for storage in databases.

By using FROM_BASE64() together with TO_BASE64() data can be easily encoded and decoded in Base64 format.
FLOORFORMATFOUND_ROWSFROM_BASE64FROM_DAYSFROM_UNIXTIMEGET_FORMAT

Further MySQL und MariaDB SQL Encryption & Compression

AES_DECRYPTAES_DECRYPT(String, Key)
More about AES_DECRYPT Function

AES_ENCRYPTAES_ENCRYPT(String, Key)
More about AES_ENCRYPT Function

COMPRESSCOMPRESS(String)
More about COMPRESS Function

DECODEDECODE(Binary string, Password)
More about DECODE Function

DES_DECRYPTDES_DECRYPT(Binary string [, Key])
More about DES_DECRYPT Function

DES_ENCRYPTDES_ENCRYPT(String [, Key])
More about DES_ENCRYPT Function

ENCODEENCODE(String, Password)
More about ENCODE Function

ENCRYPTENCRYPT(String [, Salt])
More about ENCRYPT Function

MD5MD5(String)
More about MD5 Function

OLD_PASSWORDOLD_PASSWORD(String)
More about OLD_PASSWORD Function

PASSWORDPASSWORD(String)
More about PASSWORD Function

RANDOM_BYTESRANDOM_BYTES(Length)
More about RANDOM_BYTES Function

SHASHA(String)
More about SHA Function

SHA1SHA1(String)
More about SHA1 Function

SHA2SHA2(String, Length)
More about SHA2 Function

TO_BASE64TO_BASE64(String)
More about TO_BASE64 Function

UNCOMPRESSUNCOMPRESS(Binary string)
More about UNCOMPRESS Function

Numeric functionsString functionsRegular ExpressionsDate and Time functions
Comparison functionsEncryption & CompressionConversion functionsNULL functions
Aggregate functionsWindow functionsJSON functionsGeometric functions
Sequence functionsInformation functionsDynamic ColumnsMiscellaneous functions
More information about the FROM_BASE64 SQL function: mysql.com and mariadb.com
Updated: 2023-09-24ImprintContactTerms & conditionsPrivacy & CookiesUpdatesSitemapFacebookLinkedinTwitterStatistics©2020-2024 Heino Cunze-Fischer