Pages

Friday, March 19, 2010

XAMPP phpMyAdmin Error 1045 Access denied for user

Description of error: This appears when you click the phpMyAdmin link from xampp home page. The error looks like this:

The using password: NO means that xampp configuration has no password to database server stored in it. The error could also be: Access denied for user 'root'@'localhost' (using password: YES). This error means xampp has a password for the database server but it is incorrect.

Solution:

1. Go to C:\xampp\phpmyadmin then open the config.inc or config.inc.php file


2. In line 20 you will see this: $cfg['Servers'][$i]['user'] = 'root';
Make sure that the 'root' there is the user to access your own database server. If not, change the 'root' to your own user name.



3. In line 21 you will see this: $cfg['Servers'][$i]['password'] = '';
This means that your database server doesn't have password save in it. If your database server has a password, type the password between the single quotes for example 'mysql'.

However, if there is a password stored like this: $cfg['Servers'][$i]['password'] = 'mysql'; then you have to change 'mysql' into the password your database server is using for example 'developer_password'

4. Clear your cookies then reload localhost


Hope this helps, I tried it and it worked.

16 comments:

Anonymous said...

Doesn't work....

Anonymous said...

enter the phpMyAdmin, select database, go to previleges and add your username and password

Anonymous said...

nice it works for me,thanks

Anonymous said...

Jet, thanks for telling me to clear the cookies, I tried so many times and nobody mentioned that step before. Works now! Thanks!

Anonymous said...

Thanks, its work.
I enter mypassword in line 21. SAVE
Then open phpmyadmin,go to previleges and klik no password. GO
Afterthat go back to line 21, remove password. SAVE.
Everythings back to normal.

Luis Salazar said...

i still have the problem... it does not work on my pc... please help me...

Anonymous said...

thanks :) :)

Anonymous said...

it does not working..... follow all the steps.. passowrd already is ='' so.. all the settings are already like the mentiod above.. plz help me out.. i have lot of work to do..

adnan said...

i only change the line 19 as $cfg['Servers'][$i]['auth_type'] = 'http';

set user name ='root'
and password ='123'

goto browser .. enter localhost/phpmyadmin/ .. then it requires a password give root then password 123 .. hope so it will work.. tc

Anonymous said...

nice info...!!!!

Anonymous said...

thanx for sharing.

Unknown said...

thank a lot ...

Unknown said...

Thank you very much I got it.

Unknown said...

thanks it is working

Anonymous said...

This is the best site I've ever seen.

TINYLOGIX said...

Thanks Bro It's Working

Post a Comment