Jump to content

Recommended Posts

Posted

CRUD with MySQLI and PHP Chapter 1 - Lesson 1 - 11/27/2020

After following along with Ben and coding the example and opening it in chrome ... I get the following warning ... 

Warning: mysqli::__construct(): The server requested authentication method unknown to the client [caching_sha2_password] in C:\MAMP\htdocs\connect-db-live.php on line 12

Warning: mysqli::__construct(): (HY000/2054): The server requested authentication method unknown to the client in C:\MAMP\htdocs\connect-db-live.php on line 12

Here is a screenshot from VSCode ...

image.thumb.png.c16f96a94d2349effecc332ec4dbebbb.pngimage.thumb.png.35bd767adf2b20fc52bdb42bab6a7080.png

I looked for a solution online and found a page on Stack Overflow describing a solution but I couldn't figure out how to incorporate their solution into my code.  Any assistance would be greatly appreciated.

Here is the screenshot from StackOverflow ...

image.thumb.png.2616cb877ec1fbf649f3c8f7cb178f8a.png

Michael

mastertouch53@gmail.com / mastertouch88@yahoo.com

 

 

  • 3 years later...
Posted

The error server requested authentication method unknown to the client typically occurs due to a mismatch in authentication protocols between the MySQL server and the client. This can be resolved by updating the MySQL user authentication plugin to a compatible version. Use the SQL command 'ALTER USER 'user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';` to set the native password plugin for authentication.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...