What is error 1045 in phpMyAdmin and how can it be resolved?

Error 1045 in phpMyAdmin occurs when the user credentials in the configuration file do not match the credentials required to access the MySQL database. To resolve this issue, you need to update the username and password in the configuration file to match the correct credentials.

$servername = "localhost";
$username = "new_username";
$password = "new_password";
$dbname = "database_name";

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

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