Reply to Re: Help: PHP 4.4.2 & mySQL?

Your name:

Reply:


Posted by Anonymous on 08/21/06 17:30

Lennie De Villiers wrote:
>
> Hi,
>
> 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.

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
http://dev.mysql.com/doc/refman/5.0/en/password-hashing.html for
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).

Bye!

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация