Re: help with mysql connect error

From: Date: Thu, 08 Feb 2007 17:08:01 +0000
Subject: Re: help with mysql connect error
References: 1 2 3 4 5 6 7 8  Groups: php.db 
Request: Send a blank email to php-db+get-43045@lists.php.net to get a copy of this message
Stut wrote:
Tim McGeary wrote:
Oh, duh! Ok. I wrote this:
<?php
        $hostname = "localhost";
        $username = "softread";
        $password = "XXXXXXX";
        $dbname = "software";
        mysql_connect($hostname, $username, $password) or die(mysql_error());
        mysql_select_db($dbname) or die(mysql_error());
        $result = mysql_query("SELECT * FROM Requestor_type") or die(mysql_error());
        while($row = mysql_fetch_array( $result )) {
                echo '<input name="requestor_type" type="radio" value="'.$row['description'].'">'.$row['description']."&nbsp;";
        }
?>
And got this as output:
<br /> <b>Warning</b>: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in <b>/var/www/html/mysql_test.php</b> on line <b>7</b><br /> Client does not support authentication protocol requested by server; consider upgrading MySQL client
I'm not sure I understand it. Maybe my CLI PHP script is not correct? I'm returning to PHP after 5 years of not writing in it.
This basically means that you're trying to access a MySQL 5 server with MySQL 4 client. You have two choices... 1) Rebuild PHP with the MySQL 5 client libs 2) Use the old password mechanism in MySQL See here for more info... http://dev.mysql.com/doc/refman/5.0/en/old-client.html
But I do have a MySQL 5 client: [root@webtest html]# rpm -qa MySQL* MySQL-shared-compat-5.0.27-0.rhel3 MySQL-client-standard-5.0.27-0.rhel3 MySQL-python-0.9.1-6 MySQL-server-standard-5.0.27-0.rhel3 MySQL-devel-standard-5.0.27-0.rhel3 or are you saying that the PHP libs have a MySQL 4 client in there? If that is the case, how should I rebuild PHP? Tim

« previous php.db (#43045) next »