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

Thanks for providing the solution to the problem bbparis - it worked fine for me.

However, in my opinion, writing the root password in a config.inc.php file appears to be a big security flaw. Surely, it now makes it easy for hackers to go and read your root password very easily.

Is there a way of making it more secure?

Registered to say thank you for your help everyone. bbparis & andrern2000 wonderful solutions together they both fixed the problem. For those that do not know how to clear their browsers history, cache & cookies. Indiana University knowledge base compiled a great explanation for many browsers on how to do this. Would add the link but im not sure if that is allowed.

[hr]

~Blessings~

I just registered to say thank you. My issue is resolved. :slight_smile:

Thank you. Your step by step explanation was too easy for any newbie like me to follow. Cheers mate :slight_smile:

Hello,

I’ve got the error #1045 when i try to access phpmyadmin …
So, I’ve already had an Wamp installed on my computer one year ago, since that, i deleted it, and few days ago, i installed the new version (2.2a).
So I’ve got the problem you said, but when i go to the mySQL console, i’ve got the message to enter the password, and I don’t remember him (I don’t even know if I put it in) !
So after that, I uninstalled WampServer, delete the wamp folder, reboot my computer, and re-install WampServer2.2a but still password needed !!

What should I do ?

I went to the my.ini file and uncomment the password section and put mine :

# The following options will be passed to all MySQL clients
[client]
password	= test
port		= 3306
socket		= /tmp/mysql.sock

Then i restart all services, try to enter mySQL console with that password, no changes. :frowning:

Other problem, the icon for Wamp stay orange (even if I put him online), what does that mean ?

Thanks.

Hi

Please dont do any changes on php.ini file, yet. After the fresh install of wamp server, run it. Go to your WAMP icon on your task bar and LEFT CLICK to open the menu, you will see MYSQL folder, CLICK to see MYSQL CONSOLE, open it.
In the command prompt enter the details as mentioned in my previous mail. it doesnt matter if you remember your old password or not coz your are updating it with a new password.
Once your done with it, go to WAMP folder which should be in your C Drive (localdrive) and click on APPS folder, and then click on PHPMYADMIN folder ( e.g my folder called phpmyadmin2.11.6 ) and find the config.inc.php

Open config.inc.php and you should have something like this
<?php
$cfg[‘blowfish_secret’] = ‘enter any secret password’;

/* Servers configuration */
$i = 0;

/* Server: localhost [1] */
$i++;
$cfg[‘Servers’][$i][‘verbose’] = ‘localhost’;
$cfg[‘Servers’][$i][‘host’] = ‘localhost’;
$cfg[‘Servers’][$i][‘port’] = ‘’;
$cfg[‘Servers’][$i][‘socket’] = ‘’;
$cfg[‘Servers’][$i][‘connect_type’] = ‘tcp’;
$cfg[‘Servers’][$i][‘extension’] = ‘mysqli’;
$cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’;
$cfg[‘Servers’][$i][‘user’] = ‘root’;
$cfg[‘Servers’][$i][‘password’] = ‘enter the password the you set on the DOS prompt’;
$cfg[‘Servers’][$i][‘AllowNoPassword’] = true;

Save this, restart your wamp server and you should be good to go. I have also heard that you have turn off the firewall to install WAMP server correctly. Once the installation is done you can turn it back on.
Hope this should resolve your issue. My knowledge is very limited so you can also check on other senior members for assistance.

Cheers :slight_smile:

Firstly, thanks for your reply !

But i can’t even not a single thing in mysql prompt, cause it’s asking me the password, like this :

I tried to type :
UPDATE mysql.user
or
use mysql;
in the password field, but it doesn’t work !

I’m really really bother by all that stuff, i don’t want to reinstall Windows just cause of wamp. :cry:

If you have not set any password then, in the MySQL console don’t enter any password click on enter
then you can follow the below mentioned steps

type use mysql;
and click ENTER on your keyboard
now write the following red text and click ENTER :

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

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 :

FLUSH PRIVILEGES;

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

I know that if I didn’t set any password I just have to click ‘enter’
But when I type ‘enter’, it’s like I’ve sent a password (it must have been saved somewhere, but I already uninstalled Wamp, make a clean with CCleaner, then install again, with a reboot of the machine at each step) and it’s hasn’t been deleted from my computer :

Because I’ve already made some research on the subject and already use Wamp, so I actually know how to access to mysql prompt when no password has been set, but I don’t know what to do in my case ! I’m totally stuck in my position, I think the only way to fix the whole thing is to format my Windows partition …
That’s why I hate windows, always compelled you to do thing you don’t want to …

hi can you can set password to yes on config.inc.php file
$cfg[‘Servers’][$i][‘AllowNoPassword’] = true;

and then try

Already set to true !
That’s the problem !

I think i really have to install a new fresh winshit and it would surely work then …

Quoted from report: