mysql_connect(): Client does not support authentication protocol

Follow

Applies To: 

[ PHP ]
[ All operating systems ]

Symptom

When you try to connect to a MySQL server through your PHP code

(mysql_connect()function), you get the following error:

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

Technical Details

A new authentication protocol has been implemented with MySQL 4.1.x and above . Many older PHP builds use the MySQL client API for MySQL 3.23.x. If you use an older PHP build (with the old MySQL API) then you will get the Client does not support authentication protocol error when trying to connect to a MySQL server 4.1.x or above.

Resolution / Workaround

The recommended solution is to upgrade your PHP to the latest 4.3.x or 5.1.x/5.0.x build.
If this upgrade is not possible, you can do the following and modify the MySQL settings of your MySQL user.

Run the following in your database:

UPDATE mysql.user SET Password = OLD_PASSWORD('password') WHERE User = 'user'

If you do not have root permissions, you can run this:

SET Password = OLD_PASSWORD('password')

This will change the password for your user (The user you have logged in to the database with).

Note:
Instead of 'password' in the commands above, write a password that you choose - this will be the password for your MySQL user from now on.

Further information can be obtained from the Mysql site (see the link below).


Excerpt: Client does not support authentication protocol requested by server.


Original Post Date: 2009-10-23 14:09:14

External Links:

http://dev.mysql.com/doc/mysql/en/old-client.html

Alternative Description:

Client does not support authentication protocol requested by server

_____
Tags: authentication,Debian / Ubuntu,MacOS 10.6 and earlier,MS Windows 2003 Server,MS Windows 7,MS Windows XP,mysql,mysql_connect(),password,RedHat Enterprise Linux / CentOS,SUSE Linux Enterprise Server / OpenSUSE,Zend Core,Zend Platform,oldKB

Have more questions? Submit a request

Comments

Powered by Zendesk