Bug #32483 [root@localhost:3306] ERROR 1251:Client does not support authentication protocol
Submitted: 18 Nov 2007 18:39 Modified: 19 Nov 2007 19:05
Reporter: arun kumar Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:mysql server 4.1.22 win32 OS:Windows (xp sp-2)
Assigned to: CPU Architecture:Any
Tags: MySQL, php

[18 Nov 2007 18:39] arun kumar
Description:
[root@localhost:3306] ERROR 1251: Client does not support authentication protocol requested by server; consider upgrading MySQL client

Sir i've created an simple php page to display the created databases on a simple web page, for this i've installed mysql server 4.1, php-4.3.10-Win32, apache_2.0.50-win32 as the priliminary requirement's.. 

the thing is i've created a db people, in which there is a table people_info which contains firstname,lastname of two members. When i use this database in my php program (i,e) 

<? $mysql=mysql_connect("localhost", "root", "password")
or die("cant connect to mysql");
$result=mysql_db_query("people", "select * from people_info")
or die("query failed- " . mysql_errno() . ": " . mysql_error());
?>

i've used as mentioned above but when ever i execute in my browser, (i,e) Internet Explorer-7, it gives me error at first line of my program..

ERROR IS: [root@localhost:3306] ERROR 1251: Client does not support authentication protocol requested by server; consider upgrading MySQL client

So plz sir guide me to fix this error sir..

How to repeat:
<? $mysql=mysql_connect("localhost", "root", "password")
or die("cant connect to mysql");
$result=mysql_db_query("people", "select * from people_info")
or die("query failed- " . mysql_errno() . ": " . mysql_error());
?>
<html>
<title>php & mysql</title>
<body>
<body bgcolor="yellow">
<center><table border="2">
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<? while ($a=mysql_fetch_row($result)) : ?>
<tr>
<td><? echo $a[0]; ?></td>
<td><? echo $a[1]; ?></td>
</tr>
<? endwhile; ?>
</table>
</body>
</html>
<?  mysql_close($mysql); 
?>

Try to run this program sir, at the 1st line of this program iam getting the error.
[18 Nov 2007 20:37] Peter Laursen
an extract from:
http://webyog.com/faq/content/23/58/en/error-no-1251-client-does-not-support-authenticatio...

Error no. 1251: "Client does not support authentication protocol requested by server - consider upgrading MySQL client" occurs when the hashing-method for storing password used by the client differs from the one of the server. Typically it occurs when trying to connect to MySQL 4.1 or 5.x with a client compiled for 3.x or 4.0.

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

....

SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

Note what is here UPPERCASE must be written litterally as here.

....

So basically: use a client (like PHP binary) built with a client code that 'fits' the server!  If for ssome reason you need to use an older client you can 'downgrade' the user to use the old password hash as described. 

(written by a non-mysql person)
[19 Nov 2007 5:10] Valeriy Kravchuk
This is not a bug. See Peter's detailed explanation above.
[19 Nov 2007 19:05] arun kumar
This forum iz dam cool man, my error was solved in no time with d help of peter-laursen & valeriy kravchuk u guys are awesome.... thankx aloooot loads of..