I'm working with a legacy codebase here that currently uses
It appears there is no equivalent to
OLD_PASSWORD() using MySQL functions except if the server allows globals to be set. By executing the query
SET @@global.old_passwords = 1;, under a user with super permissions, the
PASSWORD() function then hashes passwords using the
If, like in our case above, you do not have a super user (Google CloudSQL does not support them), then a replacement algorithm is needed. Below are replacements for different languages:
Disclaimer: MySQL's password functions are a joke in modern day security and should not be used if at all possible. In addition, I'm not responsible for any head asploding after taking a look at the algorithms above!