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

Share with all..

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.

Share with all..

About Abhijit Sandhan

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


  1. I did that and it still doesn't work for me

Leave a Reply

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