Syntax:
PASSWORD(str)

Calculates and returns a hashed password string from the plaintext
password str and returns a binary string, 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 PASSWORD() (as well as for the IDENTIFIED BY clause of the
CREATE USER and GRANT statements).

The value determines whether or not to use "old" native MySQL password
hashing. A value of 0 (or OFF) causes passwords to be encrypted using
the format available from MySQL 4.1 on. A value of 1 (or ON) causes
password encryption to use the older pre-4.1 format.

If old_passwords=1, PASSWORD('str') returns the same value as
OLD_PASSWORD('str'). The latter function is not affected by the value
of old_passwords.

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

