PASSWORD( )

This MySQL function encrypts a password given as an argument. The result cannot be decrypted. This MySQL function is used for encrypting data in the password column of the user table in the mysql database.

Syntax

Below is the syntax for this command. Text within square brackets (i.e, [ and ] ) are optional. Choices are separated by bars (i.e, | ). Ellipses preceded by a comma indicates a repeating pattern. Ellipses before or after syntax are used to highlight a relevant except from the larger syntax. Text displayed in italic letters represent text that should be replaced with the specific names related to the database (e.g., column with the name of the column).

PASSWORD(string)

Explanation

This function encrypts a password given as an argument. The result cannot be decrypted. This function is used for encrypting data in the password column of the user table in the mysql database.

Examples

UPDATE teachers
SET pwd = PASSWORD('test')
WHERE teacher_id = '730522';