FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Warning: mysql_connect(): Client does not support authentica





ammonkc
I'm trying to set up other users besides root and mysql. but I keep getting this error:
Quote:
Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in


I installed mysql with marc's entropy binary. after installing I added users to the grant table like this:

mysql> GRANT ALL PRIVILEGES ON *.* TO user@localhost \
-> IDENTIFIED BY 'password' WITH GRANT OPTION;

mysql> GRANT ALL PRIVILEGES ON *.* TO user@"%" \
-> IDENTIFIED BY 'password' WITH GRANT OPTION;

I can login to mysql from the command line or ssh using : mysql -u user -p.
and I can also connect to mysql using a gui mysql frontend like mysqladministrator or yourSQL. But when i try to connect from my php script it give me that error.

why is mysql giving my this error saying that my client doesn't support this authentication protocal? this is my php connection script:

Code:
<?php
$host="localhost";
$user="user";
$password="password";
$db="my_db";
$conn=mysql_connect($host,$user,$password) or die ("error connecting to mysql:".mysql_error());
$select_db = mysql_select_db($db,$conn) or die (mysql_error());
?>


I can connect with this same script using user: mysql with no password
kv
run this from mysql command line as mysql root

Quote:
SET PASSWORD FOR user@localhost = OLD_PASSWORD('yourpassword');


Then it should connect.
ammonkc
Thanks, I'll try this in the morning. I'm not at work right now. I still don't understand why I can connect to mysql fine with that same user and password with mysql administrator and with the command-line through ssh, but not through php. what is the difference?
ammonkc
Thanks! that did work. what exactly does that command do?

Quote:
SET PASSWORD FOR user@localhost = OLD_PASSWORD('yourpassword');


I don't really understand why it wouldn't connect before. because the password should've been when I entered the grant commands:

Quote:
GRANT ALL PRIVILEGES ON *.* TO user@localhost \
IDENTIFIED BY 'user1234' WITH GRANT OPTION;
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.