# phpmyadmin access Denied



## skyhigh007

Hi

I just installed the Wamp and changed the password for the root in phpmyadmin. Now I'm getting this error.

"Error
MySQL said: 
#1045 - Access denied for user 'root'@'localhost' (using password: NO)
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server. "

So do i have to put the password in the php.ini file or the apache httpd.conf ?


----------



## tomdkat

Sounds like phpMyAdmin isn't using the password parameter when connecting to MySQL. You used phpMyAdmin to change the password of the user 'root' in MySQL?

I believe in the phpMyAdmin configuration file, you specify the MySQL 'root' user password.

Peace...


----------



## skyhigh007

Maybe in the php.ini file or the apache config file to put in the username and password?


----------



## tomdkat

No, in the phpMyAdmin config file. Read the quick installation documentation, step #4 to be specific. config.inc.php is the config file you should be looking at modifying with the correct password to have phpMyAdmin connect to MySQL using the 'root' MySQL account.

That info should also be in a README or INSTALL file that is part of the phpMyAdmin installation bundle.

Peace...


----------



## maneetpuri

Hi,

No this does not have to do anything with the php.ini or httpd.conf this error is because of the reason that the login credentials you have set in phpmyadmin config file does not match with the login credentials of the mysql database you have installed. It looks to me that the MySQl you have installed does not have any password for the root user so try leaving the password blank in phpmyadmin for the user root and it might work otherwise you can create one more user in the mysql and use its details in phpmyadmin or assign the password you are using in phpmyadmin to the root user of mysql.

Hope this helps!

Cheers,

~Maneet Puri


----------



## tomdkat

maneetpuri said:


> It looks to me that the MySQl you have installed does not have any password for the root user


 How do you come to this conclusion?

The MySQL error tells me a password wasn't used for the connection and I'm thinking he NEEDS to specify a password for the connection.

Peace...


----------



## maneetpuri

Hi,

While installing the MySQL it gives a option to set a password for the root user or leave it blank, if you have set one at this stage then you will have to mention it in the connection string defined in the phpmyadmin config file otherwise it should be left blank.

How i reached this conclusion? - Is from my experience with phpmyadmin and MySQL.... 

Cheers,

~Maneet


----------



## tomdkat

Ok. I've installed MySQL a few times as well (usually from source) and part of the installation process involves issuing the "mysqladmin" command to set the root password, since the root MySQL account does not have a password set with a fresh installation. If you set the MySQL password at the time you install MySQL, your connection attempts will FAIL if you don't specify the root password. That is why I asked how you came to the conclusion you did.

If no root password was specified when MySQL was installed, the connection from localhost as user 'root' with no password should have worked.

If a root password was specified when MySQL was installed (or if one was set later on), the connection from localhost as user 'root' with no password should NOT have worked.

I guess our experiences have been different, in this regard. Have you installed MySQL from source or from a pre-buit bundle of some kind?

In any event, the root password needs to be configured in the phpMyAdmin config file.

Peace...


----------



## skyhigh007

I'm using WAMP and I don't see any phpmyadmin config files


----------



## tomdkat

Keep looking, there has to be a config file phpMyAdmin reads. 

It might not be called "config.inc.php" and might be called something else.

Did phpMyAdmin come with the WAMP bundle?

This is one of the reasons I never use a "bundled" xAMP platform since you can end up with non-standard names and locations of stuff.

Peace...


----------



## tomdkat

Ok, click the first link in this search result. and scroll to the bottom and you should get more info.

It looks like phpMyAdmin DOES come with the WAMP bundle and they didn't maintain a standard phpMyAdmin installation, for whatever reason.

Good luck!

Peace...


----------



## skyhigh007

awww the first link is the expert exchange and you have to pay to view the result.


----------



## tomdkat

If you click the expert exchange link from the Google result, keep scrolling down to the very bottom of the page. Then scroll back up and you can see the commentary.

The expert exchange tries to "hide" the content from you. Just keep scrolling past the "you gotta pay" stuff.

Peace...


----------



## colinsp

WAMP also has a very good support forum so if Tom's link doesn't help you can always ask there. 

I have a default WAMP installation on my PC and PHPMyadmin works perfectly with the default root and no password BUT I only run this in a closed development environment. If all else fails try a reinstall with the default settings and once it is all running then set your passwords.


----------



## edjon2000

What version of wamp are you using 1xx or 2_0

for example in Wamp 2 the config_inc.php file can be found at C:\wamp\apps\phpmyadmin2.11.6\ in a default installation and as a default setting it sets itself up using 'config' type authentication method with the ussrname 'root' and password'' as follows


PHP:


$cfg['Servers'][$i]['auth_type']     = 'config';    // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user']          = 'root';      // MySQL user
$cfg['Servers'][$i]['password']      = '';          // MySQL password (only needed
                                                    // with 'config' auth_type)
$cfg['Servers'][$i]['only_db']       = '';          // If set to a db-name, only
                                                    // this db is displayed in left frame

Hope this helps


----------



## tomdkat

edjon2000 said:


> for example in Wamp 2 the config_inc.php file can be found at C:\wamp\apps\phpmyadmin2.11.6\


:up: Thanks!

Peace...


----------



## edjon2000

I hope it proves helpful tomdkat


----------

