Solved

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

Posted on 2013-06-03
13
4,644 Views
Last Modified: 2013-06-10
Hello.

I installed the WAMP server. I then right-click the shortcut and run as administrator. It was obvious that PHP and Apache work, by MySQL has a problem. When I run the phpMyAdmin in the browser, I get the error:
#1045 - Access denied for user 'root'@'localhost' (using password: NO)

I use ZoneAlarm. I let it accept incoming/outgoing traffic over the port 3306 for the trusted network which of course includes "localhost".

I looked up the internet for help. It says to give localhost a password. But that can't work with phpMyAdmin coded for WAMP because phpMyAdmin is coded not to give a password.

What should I do next?

Jean
0
Comment
Question by:JeanLeFrancais
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
  • +2
13 Comments
 

Author Comment

by:JeanLeFrancais
ID: 39217841
Clarification: where I say "It says to give localhost a password. " I meant to say "It says to give  the root a password. "
0
 

Author Comment

by:JeanLeFrancais
ID: 39217866
Another thing. I installed successfully WAMP on another computer running Windows 7 as well. Same products, the only difference is the firewall.
0
 
LVL 23

Expert Comment

by:ComputerTechie
ID: 39219322
Does it work correctly if you disable zone alarm?

CT
0
IoT Devices - Fast, Cheap or Secure…Pick Two

The IoT market is growing at a rapid pace and manufacturers are under pressure to quickly provide new products. Can you be sure that your devices do what they're supposed to do, while still being secure?

 
LVL 28

Expert Comment

by:FishMonger
ID: 39219325
Did you specify a root password during the WAMP install process?

The error message is telling you that it expects root to provide a password when logging in from localhost, which is not being provided when going through phpMyAdmin.

Have you tried logging in to the cli directly at the command prompt, rather than using phpMyAdmin?

C:\>mysql -u root -p
Enter password: **********
Welcome to the MySQL monitor.  Commands end with ; or \g.
....
....
0
 
LVL 28

Expert Comment

by:FishMonger
ID: 39219423
I've never used phpMyAdmin, but a quick google search indicates that the mysql login info is stored in config.inc.php

Look for lines like this:
$cfg['Servers'][$i]['user'] = 'phpmyadminuser'; // MySQL user
$cfg['Servers'][$i]['password'] = 'the_password';
0
 
LVL 35

Expert Comment

by:gr8gonzo
ID: 39219476
1. The firewall is not the issue. The fact that you get an error message that comes -FROM- MySQL means that the communication is happening. Otherwise, you would get a timeout or general network issue.

2. WAMP is just a concept, not an actual specific software package. There are a lot of preconfigured WAMP setups:
http://en.wikipedia.org/wiki/Comparison_of_WAMPs

...so it would help to know which package you installed (e.g. WampServer, XAMPP, etc...), or if you installed each piece individually. You mentioned "The WAMP server" so I'm assuming you mean WampServer, but it's better to confirm.

3. Fishmonger is correct that phpMyAdmin does have a config file where you can specify a specific password if you set one. I would also try using HeidiSQL (a free/open-source, Windows-based MySQL client):
http://www.heidisql.com/
... and see if you can determine the correct login credentials from there.

Honestly, I prefer HeidiSQL over phpMyAdmin any day, but if nothing else, it will make it easier to test things. You should be able to reset the MySQL password if it got screwed up somehow:
http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
0
 
LVL 17

Expert Comment

by:Shinesh Premrajan
ID: 39221732
I think the latest version of the MySQL doesnt allow blank password for the database.
try this in the command prompt:
c:\wamp\bin\mysql -u root -H localhost

Then provide a blank password by pressing just enter key. If this works then there is some issue with the PHPMyadmin installation.

Hope this helps

~Shinuq
0
 

Author Comment

by:JeanLeFrancais
ID: 39232033
Shinuq,

To your command c:\wamp\bin\mysql -u root -H localhost, I get the error
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

I just don't understand. I installed the exact same WampServer version on my other laptop at work without trouble under the same OS Windows 7. I notice that my laptop at home (the one with the issue) shows a blue-yellow shield onto the Wampserver icon and other icons. I don't have any shield on the icons on my laptop at work.

Jean
0
 
LVL 28

Accepted Solution

by:
FishMonger earned 500 total points
ID: 39232047
Did you try resetting the password using the instructions that gr8gonzo linked to?
How to Reset the Root Password
0
 

Author Comment

by:JeanLeFrancais
ID: 39232132
I just realized that I had Zend Server Community edition still installed, and the MySql service running is the one from Zend, not WampServer. I tried to remove the service, but that option does not exist. Also I tried to deinstall Zend Server CE but I received an error message that the installation failed.

I do I remove Zend?

Jean
0
 

Author Closing Comment

by:JeanLeFrancais
ID: 39232382
your instruction didn't resolve the whole thing, but it was a necessary step. It turns out that I had Zend Server MySql still running as service. I removed it then ran your command from that web site and set a password for MySql, then I edited the config.inc.php file from phpMyadmin to match that password. I restarted the WampServer services, and bingo! It worked.
0
 
LVL 35

Expert Comment

by:gr8gonzo
ID: 39233506
It would be nice to get the points for being the first one to post that link...
0
 

Author Comment

by:JeanLeFrancais
ID: 39235497
I had forgotten that you were the first to post that link. Sorry.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question