totn MariaDB Functions

MariaDB: MD5 Function

This MariaDB tutorial explains how to use the MariaDB MD5 function with syntax and examples.

Description

The MariaDB MD5 function returns an MD5 128-bit checksum representation of a string.

Syntax

The syntax for the MD5 function in MariaDB is:

MD5( string )

Parameters or Arguments

string
A plaintext string that is the source.

Note

  • The MD5 function will return a 32 character hex string as the result.
  • The MD5 function will return NULL, if the string was NULL.
  • The result from the MD5 function can be used a hash key.

Applies To

The MD5 function can be used in the following versions of MariaDB:

  • MariaDB 10

Example

Let's look at some MariaDB MD5 function examples and explore how to use the MD5 function in MariaDB.

For example:

SELECT MD5('TechOnTheNet.com');
Result: 'fd1e59d32b528f2172d899a6a3111d47'

SELECT MD5('secret word');
Result: '74a11ef33c5252edfa87c4eb8b566c2a'

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

SELECT MD5(NULL);
Result: NULL