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

Open your terminal and type  mysql -u USERNAME -p  and press ENTER then it will ask your MySQL root password type your password and then press ENTER

if you will get  ERROR  like below : 

ERROR 1045 (28000): Access denied for user 'USERNAME'@'localhost' (using password: YES)

Then use sudo like below :

 sudo mysql -u USERNAME -p   and enter your pc/laptop password and then ENTER again it will ask you your MySQL root password

And then you have to run this below query :

 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_password'; 

Comments