By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,828 Members | 1,356 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,828 IT Pros & Developers. It's quick & easy.

connectivity error in mysql due to authentication protocol

nirmalsingh
100+
P: 218
hi my coding is
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. /* You should never post secure details like IP address, 
  4.    username and password on a public forum
  5.  
  6.    Removed for security
  7.    Banfa
  8.    Admin */
  9. $con = mysql_connect("<IPAddress>","<user>","<password>");//line 10
  10.  
  11. if (!$con)
  12.   {
  13.   die('Could not connect: mes' . mysql_error());
  14.   }
  15.  
  16. mysql_select_db("finance", $con);
  17.  
  18. $result = mysql_query("SELECT * FROM city_master");
  19.  
  20. echo "<table border='1'>
  21. <tr>
  22. <th>Firstname</th>
  23. <th>Lastname</th>
  24. </tr>";
  25. while($row = mysql_fetch_array($result))
  26.   {
  27.   echo "<tr>";
  28.   echo "<td>" . $row['city_code'] . "</td>";
  29.   echo "<td>" . $row['city_name'] . "</td>";
  30.   echo "</tr>";
  31.   }
  32. echo "</table>";
  33. mysql_close($con);
  34. ?> 
  35.  
database details:
----------------------
host: <snipped>
user name: <snipped>
password: <snipped>
database name: <snipped>
table: <snipped>
fields: <snipped>, <snipped>

error occured:
----------------------
Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /home/bcns/public_html/bala/testPHP/New Folder/welcome.php on line 10
Could not connect: mesClient does not support authentication protocol requested by server; consider upgrading MySQL client


i am newbie to php help me
Jan 22 '07 #1
Share this Question
Share on Google+
1 Reply


ronverdonk
Expert 2.5K+
P: 4,258
The MySQL standard documentation provides the answer to this. In short:
To solve this problem, you should use one of the following approaches:

Upgrade all client programs to use a 4.1.1 or newer client library.

When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password.

Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program. This can be done using the SET PASSWORD statement and the OLD_PASSWORD() function:
See http://dev.mysql.com/doc/refman/5.1/en/old-client.html for a detailed explanation and solution.

Ronald :cool:
Jan 22 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.