Solved

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

Posted on 2013-06-03
13
3,861 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 17

Expert Comment

by:shinuq
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

To setup a SonicWALL for policy based routing to be used with the Websense Content Gateway there are several steps that need to be completed. Below is a rough guide for accomplishing this. One thing of note is this guide is intended to assist in the…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now