0

I'm new to programming and I'm trying to make simple register/login form using PHP and MYSQL. But when I open the website there is a sign saying

Warning: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password] in D:\xampp\htdocs\reg\server.php on line 10

Warning: mysqli_connect(): (HY000/2054): The server requested authentication method unknown to the client in D:\xampp\htdocs\reg\server.php on line 10 Login

Actually I've searched for answers on google but nothing works. Here's the 10th line from the code which comes the error from

    // connect to the database
$db = mysqli_connect('localhost', 'username', 'password', 'registration');
Community
  • 1
  • 1
Wojtek
  • 51
  • 5

1 Answers1

-1

Did you edited this line and sent here?

$db = mysqli_connect('localhost', 'username', 'password', 'registration');

or sent it without edits?

you must change "localhost" to your db host. username to your DB username, and password to your DB password

EchoDino
  • 35
  • 1
  • 10