PASSWORD(string)

Description: Encrypts string as a MySQL password, returning the encrypted result.

The encryption method is that used in the MySQL user grant table and is not reversible.

Example:

  • PASSWORD('mySecret') returns 6870d782135294c9.

See also: ENCODE(), ENCRYPT(), MD5()

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.