What common error message may occur when using mysql_connect with a user password in PHP?

The common error message that may occur when using mysql_connect with a user password in PHP is "Access denied for user 'username'@'localhost' (using password: YES)". This error typically occurs when the username or password provided in the mysql_connect function does not match the credentials in the MySQL database. To solve this issue, ensure that the username and password provided in the mysql_connect function are correct and match the credentials in the MySQL database.

$servername = "localhost";
$username = "root";
$password = "password";
$dbname = "myDB";

// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);

// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";