At 1:18 PM -0600 1/29/06, Philip R. Thompson wrote:
Hi all.
I figured this question was suitable for both the MySQL list and the
PHP-General list. Here's what I'm running into.
I just installed MySQL5 and currently have PHP 4.3.11 installed. I
am wanting to connect to the mysql database on localhost, but I
get the following results:
----------
<? $link = mysql_connect('localhost', 'user', 'password'); ?>
"Client does not support authentication protocol requested by
server; consider upgrading MySQL client"
----------
Well, I have the lastest stable version of MySQL, so I did some more
research on what the problem might be. When I checked my
information for PHP using phpinfo(), it gave me the "Client API
version" for MySQL was 3.23.49. So, I'm thinking my version of PHP
cannot connect to my version of MySQL. I then considered if I
installed the MySQLi extension for PHP (supports versions of MySQL
4.1), would that help me? Or, if I just upgraded PHP to version 5,
would that help me?
Does anyone have any suggestions on the direction I should go?
Yes, the authentication protocol for MySQL changed at (I think)
version 4.1. While you *could* downgrade MySQL, you could also
upgrade your MySQL client libraries, which is what I would recommend.
If PHP was compiled statically, you'll have to recompile it;
otherwise you can just upgrade MySQL client libraries.
One other question: have you restarted your webserver since the MySQL
upgrade? If not, it's possible the libraries were upgraded when MySQL
was but your web server isn't using them. You could check by running
php -i | grep -i mysql on the commandline, or just restart the
webserver and recheck phpinfo().
The MySQLi is officially supported by PHP5 only, although apparently
a number of people are using it with PHP4.
For more info, see:
http://dev.mysql.com/doc/refman/4.1/en/php.html
http://dev.mysql.com/doc/refman/4.1/en/application-password-use.html
http://www.php.net/mysql
http://www.php.net/mysqli
steve
--
+--------------- my people are the people of the dessert, ---------------+
| Steve Edberg http://pgfsun.ucdavis.edu/ |
| UC Davis Genome Center sbedberg@xxxxxxxxxxx |
| Bioinformatics programming/database/sysadmin (530)754-9127 |
+---------------- said t e lawrence, picking up his fork ----------------+
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php