MySQL

MySQL MD5()

In SQL language, the MD5() function encrypts a string into a 32 character hexadecimal integer. The output can be particularly useful to be used as a hash key.

Note: the MD5() function uses the RSA algorithm.
 

 

Syntax:

The function is used in a SQL query as follows:

SELECT MD5('test');

This query will return the following string:

36524fa45c522b2152s0s2s1e56ad23e3254a

This practical example shows the advantage of using MD5() to create a hash key.
 

Query to update the password:
UPDATE user
SET password = MD5('new_password')
WHERE id = 5;
mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *