php mysqli_connect: authentication method unknown to the client [caching_sha2_password]
As of PHP 7.4, this is no longer an issue. Support for caching_sha2
authentication method has been added to mysqlnd.
Currently, PHP mysqli extension do not support new caching_sha2 authentication feature.
You have to wait until they release an update.
Check related post from MySQL developers: https://mysqlserverteam.com/upgrading-to-mysql-8-0-default-authentication-plugin-considerations/
They didn't mention PDO, maybe you should try to connect with PDO.
PHPMyAdmin authentication method
PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client
Try the second answer above. (Change the default authentication method on your MySQL installation).
Or... update PHP (this is the real source of the problem.) Your version of PHP has an old client library that can't connect to mysql using the latest default authentication method. That's only mildly surprising with stretch which is 3 years old.
Why I can't connect to a MySQL 5.3.36 shared server using mysqli_connect and PHP 7.4, but it will work using php 7.1?
After using mysql in terminal, I reviewed my user passwords and I got a "password needs to be 41 character hash" error message. I simply changed my passwords and it is now working. It seems that something has changed in how passwords are stored or the bug was fixed. Thanks.
Related Topics
How to Use Multiple Databases in Laravel
How to Get the Last Inserted Id of a MySQL Table in PHP
How to Insert Multiple Rows from Array Using Codeigniter Framework
Search Form With One or More (Multiple) Parameters
How to Create Multiple Where Clause Query Using Laravel Eloquent
How to Properly Add Cross-site Request Forgery (Csrf) Token Using PHP
How to Prevent SQL Injection With Dynamic Tablenames
When Should I Use 'Self' Over '$This'
What Are the Best PHP Input Sanitizing Functions
How to Get a Form Input Array into a PHP Array
What Is the Size Limit of a Post Request
How to Zip a Whole Folder Using PHP
Creating One Array from Another Array in PHP