0

I have just installed PHPMyAdmin 4.6.6 on a fresh Debian Stretch server with MySQL 8.0.21. When I try to log in I get these errors

#2054 - The server requested authentication method unknown to the client

mysqli_real_connect(): The server requested authentication method unknown to the client [caching_sha2_password]

mysqli_real_connect(): (HY000/2054): The server requested authentication method unknown to the client

There are references all over Google stating that altering the user as below will solve the problem

ALTER USER 'user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

However, this does not work for me. I have tried restarting MySQL and lighttpd. Is there another solution to this?

SteveB
  • 483
  • 1
  • 4
  • 18
  • https://stackoverflow.com/questions/52364415/php-with-mysql-8-0-error-the-server-requested-authentication-method-unknown-to Try the *second* answer. Or... update PHP (this is the real source of the problem.) Your version of PHP has an old client library that can't connect to mysql using the latest default authentication method. That's only mildly surprising with stretch which is 3 years old. – netopiax Sep 24 '20 at 00:40
  • Thank you @netopiax. If you move this to an answer I'll mark it answered. – SteveB Sep 24 '20 at 00:47
  • "fresh Debian Stretch" That is an oxymoron. What goes through people's minds when they run ancient software (for which newer versions have been around for a long time -- Buster was released over a year ago) and then waste lots of time trying to get things working on obsolete software? You tagged this post with 'lighttpd' so you should be aware that Debian Stretch ships with lighttpd 1.4.45. The latest lighttpd is lighttpd 1.4.55, which is 10 full releases newer (including 830 commits), and contains important security and bug fixes. – gstrauss Sep 24 '20 at 07:10
  • 1
    @gstrauss I don't disagree with you, but every enterprise doesn't use the very latest and greatest release. In my case, I work in a very strict environment where upgrades to operating systems take a very long time to happen. "If it ain't broke, don't fix it." Since the PHP, MySQL, and phpmyadmin installs were done using apt, it was reasonable to expect that it should have worked. The fact that it broke is not a function of the age of the software, but of carelessness on the part of one or more of the developers who maintain the legacy repositories. – SteveB Sep 24 '20 at 14:53

1 Answers1

0

PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client Try the second answer above. (Change the default authentication method on your MySQL installation).

Or... update PHP (this is the real source of the problem.) Your version of PHP has an old client library that can't connect to mysql using the latest default authentication method. That's only mildly surprising with stretch which is 3 years old.

netopiax
  • 155
  • 9
  • update PHP to which version ? it is important to specify. When you say : "Your version of PHP has an old client library that can't connect to mysql using the latest default authentication method." Which version are you talking about ? – Xsmael Dec 22 '21 at 19:04