#1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

If you get this error when trying to connect to mysql through php, it means that php was compiled with a client verison older than the version of the mysql server you're running.

#1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

Basically, it doesn't know the new language to be able to talk with the server, so it denied access.

You can check to see what version is compiled into php by creating an file called:
/var/www/html/info.php

in it, place the following code:

<? phpinfo(); ?>

Then view this file from your server IP:
http://1.2.3.4/info.php

Scroll down to the mysql section, and view the "MySQL Client" portion.  It will tell you what version is compiled into php.  The version (if correct) will match the version of mysql you're running.

If it doesn't match, php must be recompiled with the current version of mysql.

1) First ensure you have the require rpms:

[root@server ~]# rpm -qa | grep MySQL
MySQL-server-4.1.12-1
MySQL-client-4.1.12-1
MySQL-shared-4.1.12-1
MySQL-devel-4.1.12-1
[root@server ~]#

You'll need to be able to see all 4 of those rpms, and all 4 must have the same version.  If you're missing any (sometime "shared"), it would need to be downloaded from either dev.mysql.com or our files.directadmin.com/services/all/mysql server.

2) Then ensure that your php configuration is correct.

[root@server root]# cd /usr/local/directadmin/customapache
[root@server customapache]# grep mysql configure.php
--with-mysql=/usr \
[root@server customapache]#

If you don't see the /usr directory (or /usr/local/mysql for FreeBSD/Debian), then edit the configure.php and add it.  Then recompile php

./build clean
./build php n


Was this article helpful?

mood_bad Dislike 2
mood Like 0
visibility Views: 11370