w3resource

MySQL MD5() function

MD5() function

MySQL MD5() Calculates an MD5 128-bit checksum for a string. The value is returned as a binary string of 32 hex digits, or NULL if the argument was NULL. The return value can, for example, be used as a hash key.

Syntax:

MD5(str);

Argument:

Name Description
str A string whose MD5 value is to be calculated.

Syntax Diagram:

MySQL MD5() Function - Syntax Diagram

MySQL Version: 8.0


Example:

Code:

SELECT MD5('w3resource'); 

Explanation:

The above MySQL statement returns MD5 value of w3resource. The return value is b273cb2263eb88f61f7133cd308b4064.

Output:

mysql> SELECT MD5('w3resource'); 
+----------------------------------+
| MD5('w3resource')                |
+----------------------------------+
| b273cb2263eb88f61f7133cd308b4064 | 
+----------------------------------+
1 row in set (0.04 sec)

Previous: ENCRYPT()
Next: OLD_PASSWORD()



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/mysql/encryption-and-compression-functions/md5%28%29.php