The MySQL PASSWORD() function has started giving a different value on a client’s live server compared to local development servers.
This has resulted in end users not being able to log in when PASSWORD() is used to compare the stored and entered passwords.
Why this has happened I have no idea. Any thoughts?
dev mysql> SELECT PASSWORD('foobar'); +-------------------------------------------+ | PASSWORD('foobar') | +-------------------------------------------+ | *9B500343BC52E2911172EB52AE5CF4847604C6E5 | +-------------------------------------------+ 1 row in set (0.00 sec) live mysql> select password('foobar'); +-------------------------------------------+ | password('foobar') | +-------------------------------------------+ | *9061D7B8DA0D4523AD448B53D80C2B551EDF8CD1 | +-------------------------------------------+ 1 row in set (0.00 sec)
Hmm, I’m not sure what would cause password() to suddenly return different results, but the MySQL documentation for password() does state:
Are the versions of MySQL in use on the dev and live environments exactly identical?
Indeed, all of my research pointed at not using PASSWORD() for storing passwords.
I think this will be addressed in the next development cycle for the client.
(just like to point out that I’m supporting an existing system…)
Out of interest, restarting mysqld made no difference.
But restarting the whole machine fixed it.