【PhpMyAdmin】 Why do I get an error on the login screen after setting the password?

We will show you the solution if you get an error when you open phpMyAdmin’s login screen after setting up a password using XAMPP.

Cause of error

The following error message may be displayed when opening the login screen after setting the root user password with phpMyAdmin “Privileged” menu or XAMPP shell etc.

# 1045 – Access denied for user ‘root’ @ ’localhost’ (using password: NO)
mysqli_real_connect (): (HY000 / 1045): Access denied for user ‘root’ @ ’localhost’ (using password: NO)
An attempt to connect to a MySQL server has been denied. Make sure that the host, username and password in config.inc.php match the information given by the MySQL server administrator.

This is because phpMyAdmin’s configuration file (config.inc.php) does not set the changed password.

Steps to resolve errors

The error resolution procedure is as follows.

Open the “config.inc.php” file in the installation destination of 1phpMyAdmin in a text editor.

Edit the following part.
※ Insert the changed password.

$cfg[‘Servers’][$i][‘password’] = ‘Changed password’;

3 work is over.
※ If the error persists, please restart Apache or MySQL.

【Postscript】
In the case of phpMyAdmin installed on the rental server, you need to edit the following part.

$cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’;

Leave a Reply