Click to See Complete Forum and Search --> : Often asked never answered -> PHP & MySQL


AlionSolutions
November 21st, 2004, 09:54 AM
Hi Folks,
quite a long time since I visited CodeGuru last time :D

Ok, I have a problem connecting to a MySql-Database with PHP. The problem has been addressed often on the web, but noone seems to know a understandable solution. So I try it here:

First I have to tell the config-details:

Windows2000
Apache/2.0.52 (Win32)
PHP Version 4.3.9

I downloaded the latest MySQL-Package 4.1 but phpinfo() shows as client version 3.23.49.

Ok, most of you can imagine now where my problem is. When connecting to a MySQL-DB I get the error:

Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client

Ok, I read dozens of postings and articles about that error-message, but none of them gave me a clue how to get this done.

Most solution descriptions were for linux, and there was told to recompile some stuff. I don't understand anything.

As I understood, the client part of PHP is out of date and I have to update it. BUT I DOWNLOADED THE LATES PHP-VERSION ! So, what's up with this ?

Thanx in advance

Juergen

visualAd
November 21st, 2004, 12:39 PM
Sometimes the answer is closer to home than you think. This time its in the MySql online manual:

http://dev.mysql.com/doc/mysql/en/Old_client.html

Here is what it suggests to solve your problem:


To solve this problem, you should use one of the following approaches:


Upgrade all client programs to use a 4.1.1 or newer client library.
When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password.
Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program. This can be done using the SET PASSWORD statement and the OLD_PASSWORD() function.

AlionSolutions
November 21st, 2004, 12:46 PM
Hi, thanx first,
but I read thru this, and tried the things described there. Nothing worked. Maybe my english is too bad, and I got it wrong.

One question, how do I do this:

Upgrade all client programs to use a 4.1.1 or newer client library.

Hmm, I would like to, but I did download the latest php-package yesterday, so I thought the client is up to date.

What's the deal with this ?

Thanx again

Juergen

visualAd
November 21st, 2004, 05:02 PM
I have MySql 4/PHP 4.3.9 and Apache 2.5 installed on my USB disk and they all run fine. which binary are you using for the MySql server, are you ensureing its the NT binary?

AlionSolutions
November 21st, 2004, 05:16 PM
Yeehaw ! Done one of the things described in the solution again and everything worx fine now.

:wave: :wave: :wave: :wave: :wave: :wave: :wave: :wave: :wave:

Greetinx
alionsonny

visualAd
November 21st, 2004, 05:25 PM
Yeehaw ! Done one of the things described in the solution again and everything worx fine now.

:wave: :wave: :wave: :wave: :wave: :wave: :wave: :wave: :wave:

Greetinx
alionsonny Out of interest, what was it?

AlionSolutions
November 21st, 2004, 05:37 PM
Finally the UPDATE and FLUSH PRIVILEGES - solution worked.

But I forgot the FLUSH PRIVILEGES first, and this was the reason why it didn't work :eek: :eek: :eek:

Greetinx

alionsonny