2 minute read

PHP/MySQL Compatibility Bug Fix in Magento 2.2.4 Installation Phase

May 31, 2018 / Magento

Last Updated: Tuesday, February 26th, 2019

SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

Recently I ran into a frustrating issue in the Magento 2.2.4 installation phase where you connect your database, involving the error mentioned above.

I was attempting to install Magento 2.2.4 on my macOS High Sierra running Apache 2 and MySQL 8.0.11, using PHP version 7.0.40 — which, according to the Magento 2.2 “readiness check”, shows that I should have had no issue. The problem with the Magento 2.2.4 readiness check is that it does not read the MySQL version that you are connecting to your store because the “readiness check” is one step before you go ahead and connect the database.

TL;DR Solution:

The quick solution here is to check your MySQL version to make sure it’s compatible with Magento 2. If you are not using MySQL 5.6 or 5.7, and you are using PHP version 7.0.40 then you are definitely going to run into the error message above.

Explanation:

The error message should be triggering the following train of thought: “MySQL is asking Magento to provide a password that Magento does not know how to provide… this must be because something configured with my Magento version is incompatible with MySQL 8”. At that point, you should refer to some reading on the MySQL changelog (https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-4.html#mysqld-8-0-4-security) and realize that the newly added caching_sha2_password and sha256_password authentication plugins may have something to do with this. The authentication method was changed in MySQL 8.0.4, and you need to adjust your software stack to account for this.