Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: toumimi (84.6.111.---)
Date: September 16, 2009 11:38PM

If you find Mysql service, it's because you installed a previous version (standalone, or with easyphp, xampp, etc.) and service has not been deleted...
Wamp use services called wampapache and wampmysqld.
If one mysql server is running, it's normal that the second one can't use the same port...

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: molumen (---.net.upc.cz)
Date: October 17, 2009 08:20PM

Hi!

I had the same problem (error #1045).

My problem was that I had another MySQL service running at the same time, so wampserver's mysql could not start (if you look at the log file, it says "[ERROR] Do you already have another mysqld server running on port: 3306 ?" and aborts the service start).

In my case the conflict was because I have sugarCRM installed locally and its mysql service starts a system startup and uses the same port (3306) as the one required by wampmysqld.

So the only thing I had to do was to shut down sugarCRM MySQL service in Control panel >> Administrative tools >> services.

Problem solved, no need to alter the config.inc.php file at all smiling smiley

Thank you toumimi for pointing the solution to this problem!

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: lcshorter (12.228.185.---)
Date: October 31, 2009 12:28AM

I ran into this issue and the solution was appallingly simple...my browser was caching the #1045 error page. After I added a password for 'root' using the phpMyAdmin 'Privileges' tab, I also edited the config.inc.php file to use this password. These are the proscribed steps for securing the 'root' login for mySQL, so I thought I was done, but I consistently continued to get the #1045 error.

It occurred to me to try ctl-F5 to force the browser to resend the request to the server. Lo and behold, it worked!

Hope this simple answer helps someone else. I at least wanted to get it on the record, as searching the haystack of forums for a needle is no fun.

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: October 31, 2009 08:12AM

yes this happens alot to people i help... there is a button on the phpmyadmin page- OPEN IN NEW WINDOW- you should always use it when troubleshooting..



and set your broswer to "everytime i visit the page"

"Automatic" does not work

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: Ronin (---.d-ip.magma.ca)
Date: October 31, 2009 06:13PM

I am new to wamp and trying to finish installing it and Joomla. The tray icon color is white and I was able to open phpMyAdmin where I changed the password for mySQL user root. After this change, I lost the ability to access phpMyAdmin and get Error 1045. If I go in MySQL console, I can enter the new password and it is accepted! I tried most of the suggestions above with the exception of editing config.inc.php because it seems to have control characters and I was not sure if I can use Notepad to edit it.

Is there an easy way to reset mySQL password(s) in the console?
Thanks...

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: stevenmartin99 (86.40.55.---)
Date: October 31, 2009 06:29PM

you need to add the password into the config.ini


open it with notepad and fill it in


if you add me to msn ill explain how to set up an encrypted password

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: yfastud (Moderator)
Date: November 01, 2009 06:28AM


Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: palimadra (---.62.173.122.airtelbroadband.in)
Date: April 15, 2010 03:39PM

yfastud,

You are the true STUD. Thank you for posting the detailed tutorials.

Pali Madra

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: eric202010 (115.164.225.---)
Date: May 21, 2010 06:34AM

I have problem when I try to use mysql through PHP . I typed this command mysql_connect("localhost","eric",""winking smiley; but it appears an error message like this :

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'eric'@'localhost' (using password: NO) in C:\wamp\www\testing.php on line 17
Could not connect: Access denied for user 'eric'@'localhost' (using password: NO)

Does anyone know how to fix this?

Thanks in advance.

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: yfastud (Moderator)
Date: May 22, 2010 01:21AM

you need to setup db acct for that script

to setup db acct, follow this
[blog.jlbn.net]

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: chrstphrdyer (---.ips.direcpath.com)
Date: July 12, 2010 01:40AM

Let's assume I have no idea what I'm doing........Can anybody break this down in to simple steps(really simple)under this assumption.

Thank you in advance.

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: yfastud (Moderator)
Date: July 12, 2010 05:19AM

Quote

Let's assume I have no idea what I'm doing........
no idea of what??? if everything, then follow these in order

Download Wamp installer here
[downloads.jlbn.net]

To setup Wamp, follow this
[blog.jlbn.net]

To setup Backup, follow this
[blog.jlbn.net]

To setup Password, follow this
[blog.jlbn.net]

To setup Website w/ Wamp, follow this
[blog.jlbn.net]

To setup Database Account, follow this
[blog.jlbn.net]

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: kbassey (---.5-4.cable.virginmedia.com)
Date: August 19, 2010 06:20AM

Hello,

I have the same problem but mine appears any time i try to use mysql console. I no about using the -u root to go in but is there anyway i can go in normally...

PLS HELP

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: macuistin (193.1.104.---)
Date: March 10, 2011 09:36AM

Hi,

I have wampserver2.1 on a windows 7 64 bit machine and when I try to open phpadmin in my browser I get the following:

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

AND beneath this in a separate red box

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

If someone suggests changing a password I won't be able to because the required phpmyadmin won't open in the browser so please send detailed instructions (in step by step form) about how I can solve this problem.

It is a pity we can't insert screenshots into these windows.

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: makist210 (212.178.232.---)
Date: March 10, 2011 03:07PM

I have installed and set first password , then changed config.inc.php
<?php

/* 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'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'pass25';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/* End of servers configuration */

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


/* rajk - for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';


?>

then restarted wamp service , I put another password , changed config.inc.php again

<?php

/* 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'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'newpass25';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/* End of servers configuration */

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


/* rajk - for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';


?>

but when I try to access phpmyadmin it always says

Welcome to phpMyAdmin

Error
MySQL said:

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

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.

.

I can make database .. I work in mysql console and it is ok .. But phpmyadmin is not working ..
If anyone have any advice,tell me ..

I have windows 7 , and installed WampServer2.1e-x32 .



Edited 1 time(s). Last edit at 03/10/2011 03:18PM by makist210.

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: makist210 (212.178.232.---)
Date: March 10, 2011 03:11PM

and now everything works .. dont get why , but after posting this message now works ..
Off to work . smiling smiley))

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: lavanya.nagaraju (---.sify.net)
Date: March 23, 2011 11:59AM

Hi guys,

Even I got the same problem......I followed all the solutions....but my problem is still in same condition.....

Please help me out....

Thanks in advance

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: yfastud (Moderator)
Date: March 23, 2011 12:22PM

Download resetmysql here
[downloads.jlbn.net]

You should setup Backup so you can restore back to working state
To setup Backup, follow this
[blog.jlbn.net]

To setup Password, follow this
[blog.jlbn.net]

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: topnik (---.dynamic.isp.telekom.rs)
Date: May 15, 2011 04:42PM

<?php

/* Servers configuration */
$i = 0;

/* Server: localhost [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = 'localhost';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '3306';
$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'] = 'password';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/* End of servers configuration */

$cfg['DefaultLang'] = 'en-utf-8';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = 'AAA';
$cfg['SaveDir'] = 'AAA';


/* rajk - for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';


?>
That is my whats the mistake? PLEASE HELP!

Re: Error: #1045 - Access denied for user 'root'@'localhost' (using password: NO)
Posted by: rabbyweb (---.ip.primehome.com)
Date: May 31, 2011 11:00AM

Hello, i had same problem on wamp 2.1e but now i fix it.

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 :

UPDATE mysql.user
->SET Password=PASSWORD("*******")
->WHERE User="root";
don't use space on the code and 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.

example:
UPDATE mysql.user
->SET Password=PASSWORD("rabbyweb")
->WHERE User="root"
;



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

FLUSH PRIVILEGES;

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

------------------------- 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 phpmyadmin3.3.9 ) [for me C:\wamp\apps\phpmyadmin3.3.9] and find the config.inc.php

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

$cfg['Servers'][$i]['password'] = '';

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

$cfg['Servers'][$i]['password'] = 'yourpassword/rabbyweb ';


and if this line is false make it true

$cfg['Servers'][$i]['AllowNoPassword'] = true;


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

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

http://localhost/phpmyadmin/

if until it's like that before. please clean your Browser History,Cache, Cookies,


and enjoy, this is what happened with me.

Thanks

Sorry, only registered users may post in this forum.