Hello everyone am trying to connect to MySQL database but getting this error:
Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) Error: Could not establish connection.Access denied for user 'root'@'localhost' (using password: YES). Here is my code:
<?php
$host = "localhost";
$db = "resumedb";
$username = "root";
$password = "sa";
$phpConnect = mysqli_connect($host, $username, $db, $password);
//checking the if connection.
if($phpConnect === false)
{
die("Error: Could not establish connection.".mysqli_connect_error());
}
?>