Page 1 of 3 123 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Location
    Raleigh, NC
    Posts
    3
    Rep Power
    0

    Client does not support authentication protocol (was "Need Help MySQL Errors")


    HI. I recently had a crash with MySQL-Max 4.0.5beta in the Windows 2000 Server inviroment. I uninstalled it completely and salvaged the DATA directories. So i decided to go ahead and upgrade the MySQL to Server 4.1.7. But now I get an error message from all my scripts that tell me the following.

    Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL

    Can some one please assist me in fixing this matter. I am very limited in MySQL and have done hours of research trying to fix this matter. Any help with this matter would be greatly appericated.

    Thanks in advance.

    Richard Futrell
  2. #2
  3. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0
    MySQL changed the password hashing functions in version 4. There are two easy solutions.

    Either - start the server with the --old-passwords flag.

    Or: update the users password using:
    SET PASSWORD = OLD_PASSWORD('secret');
    SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

    More Info: Old Client Error

    Mods: Can we make this a sticky?

    Cheers,
    Simon
    Last edited by SimonGreenhill; December 1st, 2004 at 01:41 PM. Reason: added more details
  4. #3
  5. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,026
    Rep Power
    4210
    Originally Posted by SimonGreenhill
    Mods: Can we make this a sticky?
    done
    r937.com | rudy.ca
    please visit Simply SQL and buy my book
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Location
    Raleigh, NC
    Posts
    3
    Rep Power
    0

    Thumbs down MySQL Problems


    I would like to thank you for your quick responce. That did work for the installation of a new database. But here is my issue now. I have a backup of the DATA directory. And when I log in to the MySQL Server with MySql Control Center I am able to see all the DATABASES but I am unable to access them. I get the following errors.

    Unable To Connect To Database Server.

    Unable To Connect To Selected Database.


    the site that I need to get back up is http://www.heavensangels01.com/password_protect/index.php

    This was working with out issues before the crash. Once again any help you can provide would be most appericated.

    Thanks again.
    Richard Futrell
  8. #5
  9. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0
    Does the user you're using to access the database have permissions to access the database?
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Location
    Raleigh, NC
    Posts
    3
    Rep Power
    0

    Thumbs down


    Originally Posted by SimonGreenhill
    Does the user you're using to access the database have permissions to access the database?
    Yes. I have tried the root user and also a user that I have created just for this account. I am stumped.

    I have been trying all kinds of stuff to get this fixed. But seem to be staying in the same area.

    Once again. Thanks for you help and kindness.

    Richard Futrell
  12. #7
  13. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Location
    Trollville.
    Posts
    377
    Rep Power
    14
    Originally Posted by SimonGreenhill
    MySQL changed the password hashing functions in version 4. There are two easy solutions.

    Either - start the server with the --old-passwords flag.

    Or: update the users password using:
    SET PASSWORD = OLD_PASSWORD('secret');
    SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

    More Info: Old Client Error

    Mods: Can we make this a sticky?

    Cheers,
    Simon
    I don't quite understand this.

    It seems to work, but...

    Can you explain what these two lines do?
    Last edited by JBottero; December 19th, 2004 at 12:24 AM.
  14. #8
  15. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0
    Sure.

    When MySQL moved to v4.1, they changed the password hashing algorithm.

    Prior to 4.1, they used a hashing algorithm which generated hashes of 16 bytes in length. This was bumped up to 41 byte SHA1 hashes in 4.1* This was done mainly for better security and to cut down the risk of password interception.

    Examples:
    Code:
    mysql> select old_password('devshed');
    +-------------------------+
    | old_password('devshed') |
    +-------------------------+
    | 63719e490238211c        |
    +-------------------------+
    1 row in set (0.00 sec)
    
    mysql> select password('devshed');
    +-------------------------------------------+
    | password('devshed')                       |
    +-------------------------------------------+
    | *100603ADDBAFBFB1C375933B69B26121B77F98A5 |
    +-------------------------------------------+
    1 row in set (0.14 sec)
    The problem is that a number of programs / applications haven't been updated to deal with this hashing algorithm, so what we're telling MySQL to do is to use the old 16-byte hash (SET PASSWORD = OLD_PASSWORD('devshed') ), or to assume that all the passwords are in the 16 byte hash form (eg: "mysqld --old-passwords &").

    Lots of info here

    * Note - MySQL v4.1.0 used 45 byte hashes. Why? God knows. This was dropped back to 41 bytes in 4.1.1+

    Comments on this post

    • eightballfreek disagrees : Very helpful.
    • busmaster agrees : ^^ oops, wrong button. not that it matters to simon :)
  16. #9
  17. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2001
    Location
    Trollville.
    Posts
    377
    Rep Power
    14
    Originally Posted by SimonGreenhill
    Sure.

    When MySQL moved to v4.1, they changed the password hashing algorithm.

    Prior to 4.1, they used a hashing algorithm which generated hashes of 16 bytes in length. This was bumped up to 41 byte SHA1 hashes in 4.1* This was done mainly for better security and to cut down the risk of password interception.

    Examples:
    Code:
      mysql> select old_password('devshed');
      +-------------------------+
      | old_password('devshed') |
      +-------------------------+
      | 63719e490238211c        |
      +-------------------------+
      1 row in set (0.00 sec)
      
      mysql> select password('devshed');
      +-------------------------------------------+
      | password('devshed')                       |
      +-------------------------------------------+
      | *100603ADDBAFBFB1C375933B69B26121B77F98A5 |
      +-------------------------------------------+
      1 row in set (0.14 sec)
    The problem is that a number of programs / applications haven't been updated to deal with this hashing algorithm, so what we're telling MySQL to do is to use the old 16-byte hash (SET PASSWORD = OLD_PASSWORD('devshed') ), or to assume that all the passwords are in the 16 byte hash form (eg: "mysqld --old-passwords &").

    Lots of info here

    * Note - MySQL v4.1.0 used 45 byte hashes. Why? God knows. This was dropped back to 41 bytes in 4.1.1+
    Hmmm. So, down the line when most apps use the newer system, can this modification be reversed? And, is there a way to allow the use of both?

    Also, after I found that phpMyAdmin didn't like my latest MySQL install, I checked php itself by useing a simple mysql_connect in a test script and got the same error, so this tells me that PHP v. 4.3.2 itself does not support the new hash? Well, that sucks! I haddn't planned to migrate to php v. 5 untill after its "shake-down" period...

    This gets me thinking about the various php (and other scripting languages) database abstraction layers out there (PEAR, ADOBD, etc...). Hmmmm.
    Last edited by JBottero; December 19th, 2004 at 01:12 PM.
  18. #10
  19. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Location
    Covent Garden, London UK
    Posts
    45
    Rep Power
    12

    Thumbs up Massively helpful, thanks!


    Originally Posted by SimonGreenhill
    MySQL changed the password hashing functions in version 4. There are two easy solutions.
    Simon,

    This was very helpful, thanks. I'm using the latest version of Apache (2.0.52) with PHP v4.3.10 and MySQL 4.1, and your password-changing fix worked perfectly.

    Thanks very much, sir.

  20. #11
  21. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Location
    Covent Garden, London UK
    Posts
    45
    Rep Power
    12

    ODBC Logging-In Problems


    Actually, I've noticed something else. Once applying this fix, I can't log in using the default credentials - I get the error:

    Code:
    Access denied for user 'ODBC'@'localhost' (using password: NO)
    I can log in by running MYSQL.EXE with the following parameters:

    Code:
    mysql> mysql.exe --user=root --password=mypass
    But when I try the same fix for the user ODBC, MySQL returns:

    Code:
    ERROR 1133: Can't find any matching row in the user table
    Anyone have any ideas? All I want to do is run the command line prompt without having to constantly type in --user and --password.
  22. #12
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    1
    Rep Power
    0
    I get this same error but i don't know how to fix it in command line I use DBA central for MySQL how do i fix it using this?
  24. #13
  25. Can I get an Amen!
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2004
    Location
    Disclosed Location
    Posts
    1,076
    Rep Power
    573
    Well Simon, you seem to be the person to ask, and I know this question has been asked a thousand times, but so far the fix does not work.
    So here is my setup:
    Apache 2.0.52
    PHP 5.0.2
    MySQL 4.1.7
    Windows XP SP2

    I am trying to get phpBB up and running and getting the same "The PHP configuration on your server doesn't support the database type that you chose" that everybody else is getting. I changed the password to OLD_PASSWORD liek you suggested and was able to log back into it with it. I know the mysqld is running in the background.
    What else can I do? so far it seems like a setup problem with mysql, but could it be something else? Others have said they were running this sma e configuration and point to this sticky for the answers.
    Thansk for your help again guys.
  26. #14
  27. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0
    Can you connect via a console? Open up a command prompt, and go to c:\mysql\bin (or wherever you installed mysql), and run "mysql -u <username> -p"
    Enter your password when it asks, and see if that works.

    Comments on this post

    • JimmyGosling agrees
  28. #15
  29. Can I get an Amen!
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2004
    Location
    Disclosed Location
    Posts
    1,076
    Rep Power
    573
    yes, this does work, I also tried after changing to OLD_PASSWORD, and it still works.
Page 1 of 3 123 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo