#1045 - Access denied for user 'root'@'localhost' (using password: YES)

I first changed the root password running mysql at a prompt with

mysql -u root -p

Update password:

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';

Edited line in the file config.inc.php with the new root password:

$cfg['Servers'][$i]['password'] = 'MyNewPass'

Stop and re-start mysql service (in Windows: mysql_stop.bat/mysql_start.bat)

and got phpMyAdmin to work!

EDIT 2017: for MySQL≥5.7 use authentication_string in place of Password (see this answer):

UPDATE mysql.user SET authentication_string=PASSWORD('MyNewPass') WHERE User='root';


The problem was I have 2 instances of Mysql installed and I didn't know the password for both instances.Just check if port 80 is used by any of the programs. This is what I did

1.Quit Skype because it was using port 80.(Please check if port 80 is used by any other program).

2.Search for Mysql services in task manager and stop it.

3.Now delete all the related mysql files.Make sure you delete all the files.

4.Reinstall


Well, there are many solutions already given above. If there are none of them works, maybe you should just try to reset your password again to 'root' as described here, and then reopen http://localhost/phpMyAdmin/ in other browser. At least this solution works for me.


This worked for me. In your config file

$cfg['Servers']['$i']['password'] = 'yourpassword';

In your mysql shell, login as root

mysql -u root

change your password or update if you've forgotten the old one

UPDATE mysql.user SET Password=PASSWORD('yourpassword') WHERE User='root';

stop and restart your mysql server from the xampp control panel. phpmyadmin can login to see your databases


mysql.exe->Run as administrator or go to following path C:\wamp\bin\mysql\mysql5.5.24\bin and than right click on mysql.exe go to properties and than select tab as Compatibility and see the bottom of dialog box in privilege level and just check the Run this program as an administrator and then click apply ok.finished now you open success phpMyadmin. bye