close

[Solved] php mysqli_connect: authentication method unknown to the client

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error php mysqli_connect: authentication method unknown to the client in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How php mysqli_connect: authentication method unknown to the client Error Occurs?

Today I get the following error php mysqli_connect: authentication method unknown to the client in php.

How To Solve php mysqli_connect: authentication method unknown to the client Error ?

  1. How To Solve php mysqli_connect: authentication method unknown to the client Error ?

    To Solve php mysqli_connect: authentication method unknown to the client Error I ran the following command ALTER USER 'root' @ 'localhost' identified with mysql_native_password BY 'root123'; in the command line and finally restart MySQL in local services.

  2. php mysqli_connect: authentication method unknown to the client

    To Solve php mysqli_connect: authentication method unknown to the client Error I ran the following command ALTER USER 'root' @ 'localhost' identified with mysql_native_password BY 'root123'; in the command line and finally restart MySQL in local services.

Solution 1

ALTER USER 'mysqlUsername'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mysqlUsernamePassword';

Remove quotes (‘) after ALTER USER and keep quote (‘) after mysql_native_password BY

It is working for me also.

Solution 2

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment