I am facing this error. tried all solutions given in other threads...creating a new user@localhost and grant privileges to it. But nothing works for me...
still getting this error..
Connection failed: Access denied for user 'username'@'localhost' (using password: YES)
here is my code..
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "databasename";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
else {
echo "Connection Successful";
}
mysqli_close($conn);
?>