Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|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
add comment

6 Answers

up vote 2 down vote accepted

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;
share|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
show 11 more comments

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)

share|improve this answer
add comment

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

share|improve this answer
add comment

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

http://dev.mysql.com/doc/refman/5.1/en/adding-users.html

share|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
add comment

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.

Enjoy!

share|improve this answer
add comment

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.

Done!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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