Wednesday, May 12, 2010

PHPMyAdmin MySQL Error 1045 - Access denied for user root@localhost (using password: NO)

The dreaded error "1045 - Access denied for user 'root'@'localhost' (using password: NO)" has been baffling php developers - do a google search on it and you shall see. I spent good 3 hours on it.

I faced this error all because I decided to change the MySQL blank password to a non-blank password. And after that I tried everything I could - changing PHPMyAdmin config files config.inc.php config.default.php, reinstalling the WAMP package (I used EasyPHP), rebooting. I won't go into the details of what I tried.

And then I found a workaround - under PHPMyAdmin folder locate /scripts/signon.php and run it in the browser. You will be asked for the login details as below.

phpmyadmin-error-1045-workaround













And then another login screen pops-up, enter the mysql details:

phpmyadmin-login-windows-prompt














Finally, the screen that I wanted to see:

 phpmyadmin-screenshot













I wonder the number of years PHPMyAdmin is in development and yet we see these errors? I think PHPMyAdmin is just overrated. I just wanted some GUI to manage MySQL. For some serious development I think it's better to use window based MySQL's new Workbench software instead of the crappy web based PHPMyAdmin.

19 comments:

khaledimran.tanim said...

thank you very much..... this problem was making me mad. Now, its working :)

Anonymous said...

Thanks a lot, this is the solution that works, despite other proposals I found on the web

Anonymous said...

Now I changed password in phpmyadmin, and even the signon.php is not working...

oli said...

thank you thank you i had ben loking evry ver for my soulusion wish is not wath you are showing but you gave me the best idea in the world that fixed my propleam thank you

Anonymous said...

thank you. thank you

Anonymous said...

Hi there
I have this exact problem but cannot get this solution to work. I have typed in the pathname to my signon file which is http://localhost/wamp/apps/phpmyadmin3.2.0.1/scripts/signon.php but all I get is a 404 page not found error.
Please could you help? I'm not a developer so please tell me step by step what I need to do.
Thank you very much.
Lesley

Anonymous said...

I had a problem very strange one,now it works,maybe you can just explain to me what happened.

I was running WAMP on my PC (windows xp).
I decided to reinstall it ,but I saved my www directory.
After the reinstall the site was working properly ,I could access the database using the site,
but I got the annoying 1045 error ,using pass :NO
So mysql was working ,but phpmyadmin couldn't connect.
I changed the config.inc.php file,still no use.
The URL for phpmyadmin is

http://localhost/phpmyadmin/

and from previous experience I tried typing
(using Firefox)

http://localhost//phpmyadmin/
and it works.
What's with the / or // in firefox ?
Now even http://localhost/phpmyadmin/ works ?Straight from the wamp menu...

Unknown said...

Doesnt work for me :(

Anonymous said...

It will work for you all if you type http://localhost/phpmyadmin/scripts/signon.php
This is bound to work

Anonymous said...

Didn't work for me either. I get the initial screen, I enter username, password, host and port, click SUBMIT QUERY and BAM I get the same frustrating 1045 error and no Windows Security dialog...

Anonymous said...

Thanks a lot.Finally mine problem was solved.I had tried various way to solve the error,also reinstalled the wamp 5.0 but it wont work.http://localhost/phpmyadmin/scripts/signon.php works for my problem.But i have a doubt,how do we come to know the port number?Is it necessary to enter username,passwd etc all the time

Anonymous said...

I was gonna pull out all my hair in another 5 minutes had I not found your solution....I think phpmyadmin shd resolve this issue fast so that ppl do not waste time debugging their follies...

Anonymous said...

absolute...answer to ma problems...thnx dude..u saved my swollen eyes...!!

Anonymous said...

I'm still getting my 1045 error, I have tried the password that phpmyadmin generated for me, I think I messed up when I let phpmyadmin create the password for me and not change it right away. Funny thing is that I visualize my table contents, the one I created using phpMyAdmin =| Frustrating

Audacity to Build said...

Im getting the 1045 error access denied password yes error. It is driving me battie!! Help!!

Audacity to Build said...

I am sooo frustrated with this 1045 error. I put in the correct password, cleared my cache and everything. All other databases work. Why not this one. Help!

Scribec06 said...

What is the username supposed to be?

Anonymous said...

didn't work

Anonymous said...

One of the possible reasons for this,
make sure that no other MySql is running other than the one in wamp. Check for the mysql running in task manager processes and kill it, before running the wamp. Later restart the wamp and the browser.(Be aware by killing the process the MySql(not in wamp) installed will not work, to make this work again goto mysql installed folder in bin you find mysqld application file run it, then your old mysql(not in wamp) will run again).

Post a Comment