I've setup mysql server 8.0, Apache2.4, php 7.2 and created a simple database.
As a start I am trying to write a php code for connecting to the database but i can't figure it out. My code:
<?php
$con = mysqli_connect("localhost","Don","password","db1");
if (!$con) {
echo "Error: " . mysqli_connect_error();
exit();
}
echo 'Connected to MySQL';
?>
I get Error: The server requested authentication method unknown to the client.
I've tried several things: connect to root, 192.168.0.1 instead of localhost but nothing is working.
Any ideas? Thanks.