Why do I see this issue below during the installation of Magento 2.4?
SQLSTATE[HY000]  The server requested authentication method unknown to the client
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
This is happening because of MySQL 8, which by default uses the plugin
auth_socket. Applications will most times expect to log in to your database using a password, to do it access the MySQL via root user and run this command:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
Then try to connect using it:
mysql -u root -proot
If you are using Docker you can specify it like this example below.
Make sure that you're not using MariaDB to connect into the DB, check it using mysql --version inside your PHP container.
version: '3.7' services: db: image: mysql:8.0.0 command: ["--default-authentication-plugin=mysql_native_password"] ports: - "3306:3306" environment: MYSQL_ROOT_PASSWORD: root MYSQL_USER: magento MYSQL_PASSWORD: magento
I fixed it using