http://id2.php.net/function.mysql-connect
Anthony Boyd
27-Jul-2005 05:53
Some versions of PHP do not support the new longer passwords used by MySQL 4.1 and later. This will cause the error message that 2raptor mentioned a few posts prior to this one:
“Client does not support authentication protocol requested by server; consider upgrading MySQL client”
However, for ease of use, let’s review the two fixes right here.
First, you should upgrade to a newer PHP that supports the longer MySQL passwords. However, I don’t even know if the PHP 4.x series has been upgraded to handle this yet. So for my installation, I took a different approach — I downgraded MySQL’s passwords to the “old” shorter encryption. Here’s how:
SET PASSWORD FOR ’some_user’@’some_host’ = OLD_PASSWORD(’newpwd’);
As a real-world example, I used this query:
SET PASSWORD FOR ‘testaccount’@'%’ = OLD_PASSWORD(’secret’);
Suddenly, PHP could use the testaccount to access the database. Yay.
-Tony