[How To] 1045 Cannot log in to the MySQL server phpMyAdmin

The phpMyAdmin might display following error when trying to login:

1045 Cannot log in to the MySQL server


1) Check if MySQL service is running or not.

2) Try to login in the MySQL command prompt using the MySQL username and password. If no MySQL root password is set then set the password first.

If the above two steps work fine then:

3) Go to phpMyAdmin installation directory and open config.inc.php file in editor

4) Locate the MySQL username, password field and insert your current MySQL password.

$cfg['Servers'][$i]['user'] = 'root'; //mysql username here
$cfg['Servers'][$i]['password'] = 'password'; //mysql password here

5) Check by logging in phpMyAdmin.

Abhijit Sandhan

Loves Open Source, Blogging, Traveling, Hiking and sharing Knowledge!


Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button