CREATE USER 'user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
sudo mysql.server start
Starting MySQL
.. SUCCESS!
<?php
$link = mysqli_connect('localhost', 'username', 'password', 'db_name');
if (!$link) {
die('Connect Error (' . mysqli_connect_error() . ') '
. mysqli_connect_error());
}
echo 'Success... ' . mysqli_get_host_info($link) . "\n";
mysqli_close($link);
?>
Warning: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password] in /Users/1.php on line 2
Warning: mysqli_connect(): (HY000/2054): The server requested authentication method unknown to the client in /Users/1.php on line 2
Connect Error (2054) The server requested authentication method unknown to the client