PHP Warning: mysql_connect(): Client does not support authentication protocol requested by server;

For some reasons we have very old hard and software here at work.
I had the problem that we’ve upgraded our database servers from MySQL 4.x to MySQL 5.x.

But there is a very old provisioning tool which does not support PHP5 and so we’re stuck with an old PHP4 and a new MySQL 5 Database.
If we try to connect to the database the following error occures:

PHP Warning:  mysql_connect(): Client does not support authentication protocol requested by server;

I know, the only correct way is to change our program to support PHP5, but there are no resources left for this change and this is not my decision.

So I have searched the internet how I can get it to work and have found a really easy way:

mysql> GRANT USAGE ON *.* TO '[username]'@'%';
mysql> SET PASSWORD FOR '[username]'@'%' = OLD_PASSWORD('[password]');

This (OLD_PASSWORD()) enables the user to login with an old password wich is not supported in newer MySQL versions by default.
[username] and [password] has to get replaced by your own values.

Ein Gedanke zu „PHP Warning: mysql_connect(): Client does not support authentication protocol requested by server;

  1. gappy

    I’m not that much of a internet reader to be honest but your sites really nice, keep it up! I’ll go ahead and bookmark your website to come back in the future. Cheers

    Antworten

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.