Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Lennie De Villiers
August 21, 2006, 4:51 pm
rate this thread
I'm running PHP 4.4.2 and mySQL on MS Windows XP Home Edition in IIS 6.0.
When I try to connect to mySQL from PHP I get the following error message:
Warning: mysql_connect(): Client does not support authentication protocol
requested by server; consider upgrading MySQL client in D:\Work\LIVE
WORK\Gafachi Clone\www\dbconnect.php on line 9
Please help, how can I get mySQL working with PHP.
Lennie De Villiers
- Make Cheap International Phone Calls:
Re: Help: PHP 4.4.2 & mySQL?
That's an old and well known problem. Newer MySQL versions (I believe
4.1 and up) use a new authentication scheme. For compatibility reasons
the mysql_* functions are compiled against an old version of the MySQL
API (V3.23.49), so the mysql_connect function can't connect to the
server. Possible solutions:
1) Use the mysqli_* functions. These support the new authentication
scheme. However, these are only available in PHP5. If you can't use
that, this option is not for you.
2) Recompile PHP4 yourself against the latest MySQL API version. This
will work. However, if you upload your finished scripts to your provider
and he also uses a combination of PHP4 with an up to date MySQL your
scripts will work at home but not on your provider's server.
3) Use the old-passwords option in MySQL and make sure you convert all
your new password hashes back to the old ones. See
details. Everything you need to know is there, it takes a bit to read
and understand everything though.
I'd recommend 3) because it will always work and doesn't require to
change your scripts. However, if your scripts work on PHP5 (or only
require a few tweaks) and you are willing to make the change (or perhaps
even planned to change anyway in the near future) you should go for 1).