DEV Community

loading...

Fix PHPMyAdmin Error: requested authentication method unknown to the client [caching_sha2_password]

itsmurumba profile image Kelvin Murumba ・1 min read

While installing PHPMyAdmin on your Mac OS, you might encounter the following error:

Alt Text

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
Enter fullscreen mode Exit fullscreen mode

This error happens because of the change in authentication in the later MySQL versions.

This is how to solve the above error:

  1. Make sure your MySQL Server is running

Alt Text

  1. From your terminal, login to MySQL:

sudo /usr/local/mysql/bin/mysql -u root -p

Enter the password you used to setup MySQL

  1. Run the below command from MySQL shell:

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

OR

ALTER USER root IDENTIFIED WITH mysql_native_password BY 'password';

Replace user and password with your actual values.

Discussion (0)

pic
Editor guide