Hi,
When I run this script (with the correct password) :
<php>
$host="localhost";
$user="rf";
$password="correct";
if ($mysql_conn=mysql_connect($host, $user, '$password'))
{
$message = mysql_error();
echo "$message\n";
die("cannot connect to server\n");
print $mysql_conn;
}
<?>
I get this error message:
Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /usr/local/apache2/htdocs/valade34a.php on line 6
2 questions:
Why does this script not work with all the right values?
What to do about it so I can connect to the MySQL server?
Thanks,
RF
php - MySQL Authentication
Moderators: Website/Forum Admins, Other/Off Topic Moderators
I do not know how to tell
phpinfo() tells me:
php version 5.1.4
./configure --with-mysql --with etc.
[mysql]
client API version 3.23.56
mysql>status tells me:
bin/mysql ver 14.12 Distrib 5.0.20 for pc-linus-gnu (i686) using readline 5.0
2 Questions:
1. How to tell if your php is complied with mysql client library that is compatible with the version of mysql server?
2. How to fix it if it is not?
Thanks for your help
RF
phpinfo() tells me:
php version 5.1.4
./configure --with-mysql --with etc.
[mysql]
client API version 3.23.56
mysql>status tells me:
bin/mysql ver 14.12 Distrib 5.0.20 for pc-linus-gnu (i686) using readline 5.0
2 Questions:
1. How to tell if your php is complied with mysql client library that is compatible with the version of mysql server?
2. How to fix it if it is not?
Thanks for your help
RF
If your php binary came with your linux distribution and you can't (or don't want) to compile or upgrade (in case there's a newer binary available), you can try to following piece of advice from mysql:
http://dev.mysql.com/doc/refman/5.0/en/old-client.html
http://dev.mysql.com/doc/refman/5.0/en/old-client.html
Thanks much!
Not knowing how to make sure that my php is compiled with the mysql client library that is compatible with the version of mysql server you are running - I did the following:
cd /usr/src
rm -r php-4.4.2 and php-5.1.2 and everything I could find that looked older then php-5.1.4
then recompiled php
And this time phpinfo() showed the [mysql] client API version 5.0.20
and the error messages went away when trying to connect to MySQL
Thank you so much!
RF
Not knowing how to make sure that my php is compiled with the mysql client library that is compatible with the version of mysql server you are running - I did the following:
cd /usr/src
rm -r php-4.4.2 and php-5.1.2 and everything I could find that looked older then php-5.1.4
then recompiled php
And this time phpinfo() showed the [mysql] client API version 5.0.20
and the error messages went away when trying to connect to MySQL
Thank you so much!
RF
Who is online
Users browsing this forum: No registered users and 4 guests