topleft topright

Tranquil Hosting Blog

PHP MySQL error: Client does not support authentication protocol

This is a fairly common error to see on a web server setup with PHP and MySQL:

Client does not support authentication protocol requested by server

The most likely cause for this is that PHP is built with MySQL support, using its bundled MySQL client. The bundled MySQL client is old, version 3.23.x. MySQL introduced a new password mechanism in version 4.1 of the server. If the MySQL server is setup for the new style of passwords, clients older than 4.1 will not be able to authenticate properly.

To see if this is your problem, look at a phpinfo() on your server. Scroll down to the mysql section and check the “Client API version”. Chances are, the version displayed there is not the same as your MySQL server. For an RPM-based Linux distribution, you can fix this by installing the proper mysql-devel package and then re-compiling PHP passing “–with-mysql=/usr” to the configure script. This way, when php compiles it will use the header files for your version of MySQL.


php mysql client

Leave a Reply

Copyright © 2007, Tranquil Hosting, Inc.
Managed Dedicated Servers | Managed Virtual Private Servers | Raleigh Datacenter Colocation
Raleigh, North Carolina Premium Hosting Provider
Terms of Service