Syntax:
PASSWORD(str)

Returns a hashed password string calculated from the cleartext password
str. The return value is a string in the connection character set, or
NULL if the argument is NULL. This function is the SQL interface to the
algorithm used by the server to encrypt MySQL passwords for storage in
the mysql.user grant table.

The old_passwords system variable controls the password hashing method
used by the PASSWORD() function. It also influences password hashing
performed by CREATE USER and GRANT statements that specify a password
using an IDENTIFIED BY clause.

URL: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html

