everyone. When I try to access phpMyAdmin on Uniform Server I get the following error messages:

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

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. "

The funny thing is my username and password are both set to "root" and I have changed the IP address in the httpd.conf file to my Unique IP adddress, so I still don't know what the problem is.

Could somebody please help me out? Any help would be much appreciated.

| improve this question | | | | |
  • Is there anything in the httpd-(error)logs? Can you post your httpd-config for PHPMyAdmin? – Bart De Vos Apr 14 '11 at 6:20
  • @TiZon - This is the error that came up in the error logs : "PHP Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES) in C:\\UniServer\\home\\admin\\www\\mqsetup.php on line 64, referer: localhost/apanel/mqsetup.php" – Engprof Apr 14 '11 at 15:38

Can you log in on the command prompt? (for instance: mysql -u root -p or even just mysql -u root)

Just to make sure you're aware, the root password for the mysql service and the root password for the device are going to be different. My hunch is that there's no password set on the 'root'@'localhost' MySQL account.

If one of the command line login methods above works, then run this in the mysql prompt and edit your question to include the output (remove the password hashes; we don't need to see them, we just need to know if they're there):

select User, Host, Password from mysql.user;
| improve this answer | | | | |
  • @Shane - Ok so I have run the commands that you gave me and I entered the username "root" and the host IP address. The command prompt is still asking for some kind of output though. I am not sure if I did the right thing (Sorry, I'm new to this sort of thing). What exactly do you mean by password hashes? Are you talking about the phrase used for thr password? – Engprof Apr 14 '11 at 16:31
  • @Engprof What's it prompting for? The password hashes will be strings of letters and numbers that are part of the user table it will spit out. They're sensitive and you should edit them out of the output before posting it online. – Shane Madden Apr 14 '11 at 16:33
  • @Shane - It doesn't say...But when I placed the following command in: "select User, Host, Password from mysql.user", it just comes up blank...Does that mean that it is asking for something or that there are no user accounts in the mySQL server? What is it that I have to do to add user accounts if the latter is the case? (Thanks for clarifying that bit about password hashes by the way) – Engprof Apr 14 '11 at 16:44
  • @Engprof That command will only work if you've successfully logged into MySQL via your first command; your command line prompt would change to mysql>. What was the output from the mysql -u root command? – Shane Madden Apr 14 '11 at 16:54
  • @Shane - The command line prompt did change to mysql>. I was successfully logged into the mySQL, when I typed the "select User, Host, Password from mysql.user" into the command line prompt and welcomed to the mySQL monitor...I'm really not sure what the problem is..any ideas?? – Engprof Apr 14 '11 at 17:09

Try this:

Goto c:\wamp\apps\phpmyadmin3.3.9. Then edit the file named: config.inc.php

And in the following line, enter the password that you have setup previously:

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

If your password is "123", then:

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

I hope it would work.

if it still not work change this too

from $cfg['Servers'][$i]['AllowNoPassword'] = true;

to$cfg['Servers'][$i]['AllowNoPassword'] = false;

(first part taken from akhileshbc answer)

| improve this answer | | | | |

Guys, I have been working on this 1045 issue for a week now and finally I have figured out:

You need to do it on command prompt when configuring your config.inc.php is not working.

Open up config.inc.php and empty the password field.

Follow the link below to see the instructions: http://www.configure-all.com/phpmyadmin.php

| improve this answer | | | | |

Create another mysql user for your database and give that user permissions to access the database across the network.


| improve this answer | | | | |
  • The quoted error states that the login attempt is coming from localhost; root ought to be fine. – Shane Madden Apr 14 '11 at 5:22
  • @Shane - But the username and the password is root and it's still not working...Any idea as to why? – Engprof Apr 14 '11 at 15:56

Go to
[Wamp directory]\apps\phpmyadminx.x.x\config.inc.php

Check if not added

$cfg['Servers'][$i]['AllowNoPassword'] = true; 
$cfg['Servers'][$i]['verbose'] = 'localhost'; 

Restart wamp.


| improve this answer | | | | |

This is how I fixed it:

  1. placed another phpmyadmin on my www directory
  2. logged in with another user credential
  3. changed the root password
  4. went to \uni_con\includes\mysql_password. Edit the file and given new password.
  5. Restart mysql server.


| improve this answer | | | | |

Sorry Guys, Its not any server fault but i think the lack of some knowledge about sql. Just go to wamp server in right corner on the taskbar and click the mysql then go to mysql console set there password and window will set and will go disappear. Then go with the file config.nic.php and edit it with username (whatever u like or use already set) and password shoulde be blank as you already set it in mysql console. One more step is here you will set auth_type from config to http like this-> $cfg['Servers'][$i]['auth_type'] = 'http'; and then save all and now access you phpMyAdmin it will prompt you for username and password use the same as you set earlier and enjoy. It will defenitely work in error 1045 :)

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.