Page 1 of 1

problem connecting to mysql database

Posted: Sun Dec 18, 2005 9:56 am
by jasongr
Hello

I am trying to connect to a remote mysql database using an account which I created
When I use the following command from the shell:

Code: Select all

mysql -h host -u user -p
I connect successfully everytime

However, when I try to connect to the mysql server from PHP using
mysql_connect(host, user, password)
I keep failing.

Is there a way to determine what caused the problem?
is there some entry in a log file which I can refer to?

regards

Posted: Sun Dec 18, 2005 10:26 am
by jasongr
I investigated further and found out that the I am getting the following error message:

Code: Select all

Client does not support authentication protocol requested by server; consider upgrading MySQL client
According the the MySQL manual:

Code: Select all

MySQL 5.0 uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older (pre-4.1) clients. If you upgrade the server from 4.1, attempts to connect to it with an older client may fail with the following message: 
shell> mysql
Client does not support authentication protocol requested
by server; consider upgrading MySQL client
Note that I am connecting successfully from the shell command

The only problem I am having is connecting to the mysql server from my php application

any help would be appreciated

Posted: Sun Dec 18, 2005 11:35 am
by jasongr
I just managed to solve the problem
I went to phpmyadmin (which I used to create the user), and used

Code: Select all

SET PASSWORD FOR user@localhost = OLD_PASSWORD('password');
That seemed to have solved the problem
I am guessing that the client that phpmyadmin was using was an older one