Sunday 14 February 2010

Err :1045 Access denied for user 'root@localhost'(using password NO)

Wampserver installed, changed your root@localhost mysql password but now can't log into phpmyadmin?

Well I thought I would post this to hopefully help anyone else who has fallen into this trap.

After installing wampserver I had a working webserver, after reading how to secure my wampserver installation as I was using it as a development server that was public facing, One article sugested that I give my sql database a password, which makes perfect sense. Only in doing this via phpadmin and going to privileges changing the root@localhost password to mypassword I found myself unable to get back into phpmyadmin.

The solution was as follows:

Find \apps\phpmyadmin3.2.0.1\config.inc.php
mine was at:

C:\wamp\apps\phpmyadmin3.2.0.1\config.inc.php

$cfg['Servers'][$i]['password'] = ”; // MySQL password

Change this so that it’ll reflect your current mysql password.

$cfg['Servers'][$i]['password'] = ‘your_password_here‘; // MySQL password

And don't forget to save!

If you want to secure wampserver look at this article this method of securing wampserver avoids getting locked out and has quite a few other sensible suggestions.

out of coincidence I found after restarting the services I typed in localhost only to be redirected to www.localhost.com. Basically apache wasn't starting despite restarting all wampserver services. The solution was to go into the wampserver console and stop each service mysql and apache and then start apache first then mysql. Thats it!

Here's a picture of the wampserver console where you stop and stop the apache service

this is an image to help resolve an issue on  wampserver when getting Err :1045 Access denied for user 'root@localhost'(using password NO) whilst connecting to myphpadmin after changing your root@localhost password

I have to give credit to rudy.egenias.jr as although his solution was for xampp-1.5.3a it worked for me using wampserver

No comments:

Post a Comment