mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication.
If php is throwing you this error, you've likely got an older system with:
old_passwords=1set in your /etc/my.cnf file. The "old_passwords" is used tell MySQL to use the old password hash format, that was used back in the days of MySQL 4.1. It's not recommended anymore.
However, if you set:
old_passwords=0and restart mysqld, you might still not be able to login to mysql via your php script because mysqlnd doesn't support the older method.
The recommended solution is to reset *all* of your mysql password, such that they use the newer format (after disabling old_passwords=1), but this is not likely going an option if you've got hundreds of clients, as you won't know their password (plaintext value required for the reset).
The simpler solution is to recompile php so that it does not use mysqlnd.
To do this with CustomBuild 2.0, (example: php 5.3):
2) Confirm the custom configure.php53 is being used:
./build used_configsand recompile php:
./build php n
NOTE Although this will allow scripts to login to mysql, where the old password has exists for this account, any script that uses the mysql PASSWORD() function may need to either replace said function with OLD_PASSWORD(), OR update their passwords to the new format.
Either way, all accounts are recommended to be reset.
If you view the mysql.user table as da_admin or root, run the query:
SELECT user, length(password) as using_old_password FROM mysql.`user` WHERE length(password) = 16;to view who has not reset their password. 16 byte password hashes are the old format, and 41 bytes are the new format. Once all accounts are using the 41 character length, then you can go back to using mysqlnd.
© 2018 JBMC Software, Suite 173 3-11 Bellerose Drive, St Albert, AB T8N 1P7 Canada. Mon-Fri 9AM-5PM MST