Solved

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

Posted on 2013-06-03
13
4,329 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

You may have a outside contractor who comes in once a week or seasonal to do some work in your office but you only want to give him access to the programs and files he needs and keep privet all other documents and programs, can you do this on a loca…
There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. 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 capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

732 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