Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 26
  1. #1
    Senior Member jbagley's Avatar
    Join Date
    Sep 2004
    Location
    Cape Town
    Posts
    845
    Member #
    7422
    This is the error I get when trying to connect to MySQL(4.1) db.

    Client does not support authentication protocol requested by server; consider upgrading MySQL client
    Help?

    P.S. Im learing PHP and MySQL... This is the first time im trying to connect to the DB. I have PHP 5 and MySQL 4.1 setup correctly. Let me know if you need the code that Ive written...

  2.  

  3. #2
    Senior Member jbagley's Avatar
    Join Date
    Sep 2004
    Location
    Cape Town
    Posts
    845
    Member #
    7422
    Quote Originally Posted by WDF Rules
    Do not unnecessarily "bump" a thread (reply to a thread simply to push it to the top of a list of threads). Wait at least 12 hours before bumping a thread.
    Need some help please!

  4. #3
    Senior Member jbagley's Avatar
    Join Date
    Sep 2004
    Location
    Cape Town
    Posts
    845
    Member #
    7422
    here is the code Im running. Is their anything wrong with this code?

    Code:
    <HTML>
    <HEAD>
    <TITLE> Testing php-mysql connection </TITLE>
    <HEAD>
    <BODY>
    <?php
    
      // Connect to the database server
      $dbcnx = @mysql_connect("localhost",
               "root", "qw");
      if (!$dbcnx) {
        echo( "<P>Unable to connect to the " .
              "database server at this time.". mysql_error() . "</P>" );
        exit();
      }
    
      // Select the database
      if (! @mysql_select_db("jason") ) {
        echo( "<P>Unable to locate the joke " .
              "database at this time.</P>" );
        exit();
      }
    
    ?>
    <P> Here are all the records in the database: </P>
    <BLOCKQUOTE>
    
    <?php
    
      // Request the result of all the records
      $result = mysql_query(
                "SELECT name FROM users");
      if (!$result) {
        echo("<P>Error performing query: " .
             mysql_error() . "</P>");
        exit();
      }
    
      // Display the result of each record in a paragraph
      while ( $row = mysql_fetch_array($result) ) {
        echo("<P>" . $row["name"] . "</P>");
      }
    
    ?>
    
    </BLOCKQUOTE>
    </BODY>
    </HTML>

  5. #4
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    I ran into this problem before... it has to do with 4.1's new password protocol. Try resetting root's password using something like:

    Code:
    UPDATE user SET `Password` = OLD_PASSWORD('yourpassword') WHERE User = 'root'
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  6. #5
    Senior Member jbagley's Avatar
    Join Date
    Sep 2004
    Location
    Cape Town
    Posts
    845
    Member #
    7422
    I tried what you said.

    Is this updating the password for Root? It was successful. I replaced 'yourpassword' with 'qw' - my password that I want to use. is this right?

    But it still doesnt seem to work. I get the same error....

  7. #6
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Interesting... try using mysqli_connect and mysqli_* for your function, and then if that doens't work... resetting roots password using new password algorithm (just PASSWORD() ). It's beyond me why they decided to break backwards compatability so much with this new version.

    When all else fails: Install a 4.0 version of mysql.
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  8. #7
    Senior Member jbagley's Avatar
    Join Date
    Sep 2004
    Location
    Cape Town
    Posts
    845
    Member #
    7422
    I used mysqli_connect. Seems like this works. But now nothing is printed to the screen... There is data in the table.

    Could you have a look at my loop that prints out. Does it look right?

  9. #8
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    You use mysqli_select_db and mysqli_fetch array as well?
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  10. #9
    Senior Member jbagley's Avatar
    Join Date
    Sep 2004
    Location
    Cape Town
    Posts
    845
    Member #
    7422
    Yes, I used mysqli for all of the methods. It still doesnt display anything....

    I used mysqli with the errors aswell. But none are printing out if they are supposed to.

  11. #10
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Have you looked at the source? Are you spitting out empty P tags? Or does it end after the opening <blockquote> ? Try printing out mysqli_num_rows($result) to see how many it returns. Your loop looks good.
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site


Page 1 of 3 1 2 3 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:15 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com