PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client

I’m running MySQL version 8 on PHP 7.0. I’m getting the following error when I try to connect to my database from PHP: Connect Error: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client PHP might show this error Warning: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password] in D:\xampp\htdocs\reg\server.php … Read more

Authentication plugin ‘caching_sha2_password’ cannot be loaded

You can change the encryption of the user’s password by altering the user with below Alter command : ALTER USER ‘username’@’ip_address’ IDENTIFIED WITH mysql_native_password BY ‘password’; OR We can avoid this error by make it work with old password plugin: First change the authentication plugin in my.cnf file for Linux / my.ini file in Windows: [mysqld] … Read more