Warning: PDO::__construct(): The server requested authentication method unknown to the client [mysql_old_password]
SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

I get the error above while trying to connect to my MySQL database server on Hostgator, using a PHP script on my local server. I understand it's a password hashing issue usually between pre MySQL 4.1 and MySQL 4.1+.

I've changed my local server to use the old_password following the instruction I found here.

After changing it to 16 bit hash, I still can not connect, and the error message remains the same. And more so, I can no longer login to phpmyadmin. I'm using XAMPP on windows. Please any suggestions on how to solve these problems?

2 Answers 2


Since you did this changes to the MySQL side, your only other option is to downgrade PHP.

Other links support this:

  • Downgrading PHP solved the problem. Thank you very much.
    – Chibuzo
    Commented Mar 10, 2013 at 9:55

I had the same error, trying to debug locally some application that connects to remote DBs. When using php < 5.3, everything worked. When using php 5.3 or greater, error shows up.

After hours spent reading and tweaking, i realized this only occurred when connecting as a certain user. All databases i use have new password length (41).

I changed the password for that user, and everything worked fine, even after changing it again to the previous value.

Hope this helps someone.

  • 3
    Changing the password, even setting it to the old password and restarting the mysql server did for me. Thanks!!
    – MikeGA
    Commented Jun 16, 2015 at 0:15
  • Changed the user's password to the existing password and it works now. Fortunately didn't have to restart mysql as this is a shared server. Commented Feb 10, 2022 at 2:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.