Mysql Password Problem

Posted on October 18 2009 by admin
A change to such an account’s
password made via GRANT,
PASSWORD(),
or SET
PASSWORD results in the account being
given a long
password hash. From that point on, no pre-4.1
client can
authenticate to that account until the client
upgrades to 4.1.

To deal with this problem, you can change a password in a
special way. For example, normally you use SET
PASSWORD as follows to change an account password:

mysql> SET PASSWORD FOR 'some_user'@'some_host' = PASSWORD('mypass');

To change the password but create a short hash, use the
OLD_PASSWORD() function instead:

mysql> SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('mypass');

OLD_PASSWORD() is useful for situations in
which you explicitly want to generate a short hash.

Leave a Reply