1

When trying to access phpmyadmin on my localhost, I get these errors:

Cannot log in to the MySQL server

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

After research, I understood that I need to change the authentication method for my user's password. Which I did as per this link. I also made sure that the info in the config.inc.php file are correct. Yet, I'm still getting the same error.

I can't seem to understand:

  1. What is the current authentication method for MySQL?
  2. What should it be?
  3. How do I change it? And is it change for the whole MySQL configuration or for each user separately?

Update I noticed two things:

  1. There is "password" field in the user table, but an "authentication_string"
  2. The length of the "authentication_string" is 41. Although I set the password to 9 characters and log in using them.
    1. The "plugin"'s value is "caching_sha2_password"

  • macOS High Sierra 10.13.3
  • Apache 2.4.28
  • PHPMyAdmin 4.8.0.1
  • MySQL 8.0.11
Dharman
  • 30,962
  • 25
  • 85
  • 135
zalyahya
  • 153
  • 1
  • 7
  • 18

1 Answers1

1

It seems like MySQL changed their authentication style between releases 8.0.4 and 8.0.11. I don't really understand why such a big change would be implemented in a minor release, breaking semantic versioning, but nonetheless here we are.

There are already a PHP bug report and a phpMyAdmin bug report about this.

A previous Stackoverflow question about this came with an answer that suggested making some changes to the MySQL configuration and modifying a user account...while I haven't actually tested this and don't really endorse the changes it suggests, it seems to be the only way to get MySQL 8.0.11 to work with PHP/phpMyAdmin at this time.

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
  • Thank you @Issac. I have already checked the question you're referring to and tried it. However, it didn't work. I'll dig deeper into it. If you have any other suggested solutions, please let me know. – zalyahya May 08 '18 at 09:20