connectivity error in mysql due to authentication protocol

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nirmalsingh
    New Member
    • Sep 2006
    • 218

    connectivity error in mysql due to authentication protocol

    hi my coding is
    Code:
    <?php
    
    [b]/* You should never post secure details like IP address, 
       username and password on a public forum
    
       Removed for security
       Banfa
       Admin */[/b]
    $con = mysql_connect("<IPAddress>","<user>","<password>");[B]//line 10[/B]
    
    if (!$con)
      {
      die('Could not connect: mes' . mysql_error());
      }
    
    mysql_select_db("finance", $con);
    
    $result = mysql_query("SELECT * FROM city_master");
    
    echo "<table border='1'>
    <tr>
    <th>Firstname</th>
    <th>Lastname</th>
    </tr>";
    while($row = mysql_fetch_array($result))
      {
      echo "<tr>";
      echo "<td>" . $row['city_code'] . "</td>";
      echo "<td>" . $row['city_name'] . "</td>";
      echo "</tr>";
      }
    echo "</table>";
    mysql_close($con);
    ?>
    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
    Last edited by Banfa; Jan 22 '07, 02:00 PM. Reason: Removed security details
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    The MySQL standard documentation provides the answer to this. In short:
    Originally posted by MySQL doc
    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:

    Comment

    Working...