MariaDB Tutorial MariaDB Advanced MariaDB Database Account Management MariaDB References

MariaDB MD5() Function



The MariaDB MD5() function returns an MD5 128-bit checksum representation of a given string. This function returns a 32 character hex string as the result. The result from this function can be used as a hash key.

The MD5() function returns NULL if the string is NULL.

Syntax

MD5(string)

Parameters

string Required. Specify the plaintext string used to generate the MD5 128-bit checksum.

Return Value

Returns the MD5 128-bit checksum representation of a string.

Example:

The example below shows the usage of MD5() function.

SELECT MD5('xyz');
Result: 'd16fb36f0911f878998c136191af705e'

SELECT MD5('password');
Result: '5f4dcc3b5aa765d61d8327deb882cf99'

SELECT MD5('alphacodingskills');
Result: 'de0e02d2e002982195993556f112635c'

SELECT MD5(123);
Result: '202cb962ac59075b964b07152d234b70'

SELECT MD5(NULL);
Result: NULL

❮ MariaDB Functions