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

Hi all.
Not long at this. Yesterday I uninstalled wamp5 and installed latest wamp2. I entered password in sql console which it now accepts each time I log on to sql console. However when I try to access mysqladmin it returns:
#1045 - Access denied for user ‘root’@‘localhost’ (using password: NO)
Any help much appreciated.
Thanks and kind regards,

I don’t want to state the obvious but

the login mysqladmin uses is wrong. it appears mysqladmin logs in using username ‘root’ and password ‘’ (blank)


Many thanks Ruben.
When I first installed wamp2 I could access phpmyadmin. But once I created password in mysql console as it suggested I should for security reasons then phpmyadmin immediately hit me with above error.
Do I need to reconfigure something somewhere?
If so what and where?
Sorry for being so slow.
Kind regards,

you have to specify the password in the config.inc.php file for phpmyadmin.

Many thanks fellas.
Thanks to you things are swimming again and everything is rosy.
And Longneck I’ve left a pint of Guinness for you at the bar!

For any other fellow newbies here is the whole fix:-
mysql>UPDATE mysql.user
->SET Password=PASSWORD(“*******”)
->WHERE User=“root”;

This is from Sitepoint’s “Build your own Database Driven Website using PHP and MYSQL”

And then as Longneck said specify the password in the config.inc.php file for phpmyadmin.

Kind regards,

I’m just to confirm you that it’s the solution.

yesterday I tried to fix the problem, but the only think that was missing is the first line in MySQL command:

UPDATE mysql.user

I was writing ( UPDATE mysql ) : so please follow the next steps if you want to resolve your problem with ( #1045 - Access denied for user ‘root’@‘localhost’ (using password: NO):

1 : go to your WAMP icon on your PC desktop screen and LEFT CLICK to open the menu, you will see MYSQL folder, CLICK to see MYSQL CONSOLE, open it.

2: now you have DOS screen ( a black screen ) :

A: if you already set a password, type it
B: if you did not do this step yet, write the following red text
B1: use mysql; and click ENTER on your keyboard
3: now write the following red text and click ENTER :

    [COLOR="red"]UPDATE mysql.user [/COLOR]
 ->[COLOR="red"]SET Password=PASSWORD("*******")[/COLOR]
 ->[COLOR="red"]WHERE User="root";[/COLOR]

don’t worry about this sign ( -> ) , because for example when you write ( UPDATE mysql.user ) and you click ENTER on your keyboard, a new line appear with this sign ( -> ), your command will execute when you write this sign ( ; ) at the end of your text and click ENTER.

NOTE: replace the password ******* by your password.

4: now write the following red text and click ENTER :


5: and to exit the black DOS screen now, write exit and click enter.

------------------------- we are finished from MySQL now --------------

6: go to WAMP folder ( open your My Computer, click on C driver, and you will see WAMP folder ), click on APPS folder, and than click on your PHPMYADMIN folder ( e.g my folder called phpmyadmin2.11.6 ) and find the config.inc.php

7: open config.inc.php and find the following orange text:

$cfg[‘Servers’][$i][‘password’] = ‘’; // MySQL password (only needed

and add your password now that you used in step number 3 like that :

$cfg[‘Servers’][$i][‘password’] = ‘yourpasswordhere’; // MySQL password (only needed

8: now save this modification, and close config.inc.php

9: go to your web browser and type the following link :


and enjoy, this is what happened with me.

NB: I wrote all this explications, because I’m also learning PHP and I found a lot on this website helped me, so I’m trying also to help you.

for me the error still show up guys help…

this part
$cfg[‘Servers’][$i][‘AllowNoPasswordRoot’] = false;

was set to true instead of false and was cuasing the error
on the config.inc.php

I still have same error and I entered password into the config file like I have read all over is there anything else to do?

First of all, you are welcome giorgiok.

Hello Taralee02, please can you repeat the steps above, when you enter the following text :
UPDATE mysql.user
->SET Password=PASSWORD(“*******”)
->WHERE User=“root”;

make sure to write your password ( your password should replace the stars ) example:
if your password is ( apple ) than you have to write the command like that :

UPDATE mysql.user
->SET Password=PASSWORD(“apple”)
->WHERE User=“root”;

and after that don’t forget ( FLUSH PRIVILEGES; ) command ( step number 4 )

now number 7 is very important, please repeat the steps and try again, and don’t forget number 7, I’m waiting you.

Thanks! Ya I saw somewhere about deleting temp files and cookies so I did that and it seemed to work once and then when I tried to get back in I just got a white page that said done. Sometimes it will say it can’t be displayed when I go to localhost. Before though my wamp was yellow and I don’t think it was connecting to mysql. Now it goes all the way over and it is black. I am new to this. I just installed this 3 days ago. I was referred to try jumla because it is suppose to be easy to use and you don’t have to know much coding. I was taught to use dreamweaver and coding is usually hard for me. I thought I would try it out. :smiley: I just tried it again now and it did let me into my phpmyadmin. I don’t know if it will let me back though. I will close it and try again…Do you know why it would go to a white page and say blank though? I just wait a while or mess with my IE (internet explorer) settings and it seems to work again. Maybe it’s IE? Thanks again for the help!!!

Ya I closed it and tried it again and now it is a white page again and says done. I don’t understand that. :frowning: I will try firefox. :smiley:

I have a blog with all the issues I was having on it, but I can’t post it since I am new to the forum. I am going to just copy and paste my issues. Sorry…I know most of it doesn’t matter anymore since I am not having the issue, but maybe it would be helpful information. I am also sorry for so many replies. I kept thinking of things to say. Thanks!

com…I can’t post links, so I figure you can assume what this is maybe…sorry :-S…just when I hit enter from taraleedesignsblog to com put a dot between them haha thanks! Sorry ohhh and I tried it in firefox and it works everytime, so it must be something with IE…So I got it working!!!

SQL Errors
I am unsuccesfull logging into sql database when trying to instal. The installation fails on the security. It says I may have a firewall blocking it. I turned it off and still no luck and my phpmyadmin will not login. Althought it logged in one time after I first installed it. Here is my error. If you have any information on how I could fix this issue, it would be greatly appreciated.

phpmyadmin error:

Error Number 1045.
Access denied for user ‘root’@‘localhost’ (using password:NO)

SQL installation error:

MySQL Server Instance Configuration Wizard
MySQL Server Instance Configuration
Configure the MySQL Server 4.1 server instance.
Processing configuration…

/ Prepare configuration
/ Write configuration file (c:\Program … \my.ini)
/ Start service
x Apply Security settings

The security settings could not be applied.

This is what happens when I try password fix:

After the configuration wizard locks up by giving me error:1045, I start the MySQL command
line client and press ENTER when asked for a password, but the command line client exits
on me.

Now getting a white page on phpmyadmin that just says done and the wizzard says service can not be started on the restart service step

Now getting…#1045 - Access denied for user ‘root’@‘localhost’ (using password: YES)

Sorry I have a new question…

I was able to get into this page…localhost/administrator/ It was to get into this joomla that I was told about, but now that doesn’t work, but it did before I messed with any settings to get phpmyadmin to work. Which doesn’t make sense to me because the config file is in the phpmyadmin folder which is in a different folder. It is all in the wamp folder, but ok…here is what I mean.

Path for admin folder:


Path for phpmyadmin config file:


The error it gives me when I try to go to localhost/administrator/ is… Database Error: Unable to connect to the database:Could not connect to MySQL

Do you know how I could fix this? It used to ask me for my login and I would enter it and I was in, but now it doesn’t. :frowning: Thanks for any info!

hello, I read your posts from my iPhone, I will send your my reply with some solutions from office during the day, can you please tell me which version of php you have ?

php 5.3.0

I think I messed it up…I was trying to figure out why I could not get into joomla admin page now getting the database error and was messing with my phpmyadmin priviliages and i change some but then I clicked something to set them back to the defaults and now I can’t get into phpmyadmin again… :frowning: It’s ok no hurry. It jus frustrating, but I am sure I will get it! Thanks so much!

I am getting this error now for my phpmyadmin:

#1045 - Access denied for user ‘root’@‘localhost’ (using password: YES)

and for my localhost/adminitrator I get:

Database Error: Unable to connect to the database:Could not connect to MySQL

Thanks again!

my config.inc for phpmyadmin:
-this is how it was when it was working earlier


/* Servers configuration */
$i = 0;

/* Server: localhost [1] */
$cfg[‘Servers’][$i][‘verbose’] = ‘localhost’;
$cfg[‘Servers’][$i][‘host’] = ‘localhost’;
$cfg[‘Servers’][$i][‘port’] = ‘3307’;//I had changed it I think when I set it up I can change it back to 3306. I don’t think its making a difference for me anyway.
$cfg[‘Servers’][$i][‘socket’] = ‘’;
$cfg[‘Servers’][$i][‘connect_type’] = ‘tcp’;
$cfg[‘Servers’][$i][‘extension’] = ‘mysqli’;
$cfg[‘Servers’][$i][‘auth_type’] = ‘config’;
$cfg[‘Servers’][$i][‘user’] = ‘root’;
$cfg[‘Servers’][$i][‘password’] = ‘mypassword’;
$cfg[‘Servers’][$i][‘AllowNoPassword’] = false;

/* End of servers configuration */

$cfg[‘DefaultLang’] = ‘en-utf-8’;
$cfg[‘ServerDefault’] = 1;
$cfg[‘UploadDir’] = ‘’;
$cfg[‘SaveDir’] = ‘’;



first of all try to do that :

  1. go to php website and downalod php version 5.2.9, install on your PC and when you finish.

  2. go to the small WAMP icon on your PC screen ( right below ) and select PHP >> Version, you will find 2 versions, select version 5.2.9

waiting your replay

Ok that took me a bit to get because it didn’t like it at first…it was…when I chose the 5.2.9, I got a window that says apache closes because it had a problem and then wamp puts itself back to the 5.3, but now it stayed. :slight_smile: I have same error. :frowning:

I am not sure if image upload will work, but I am trying. :slight_smile:

ok…they didn’t oh well ok my error is…

MySQL said:

#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.

and go see images I was trying to upload if would like…


Hi bbparis,

Thank u very much for ur post at (sitepoint on Aug 2008) regarding PHPMyadmin problem.
I have problem with PHPMyadmin (Wamp). Though i tried a lot from others suggestions,
but it wasn’t fixed my problem.
I tried ur solution. It works.
Though im not at all registered user in it. So I registered myself to say thanks to u.
Im very grateful to ur valueable & detailed suggestion.

Once again thanks a lot.:slight_smile:
Shall i ask u, if i got any other doubt in PHP?