Solved

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

Posted on 2013-06-03
13
3,999 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
  • 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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 34

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 34

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Creating and Managing Databases with phpMyAdmin in cPanel.
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 Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

773 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