• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
Bartenders:
  • Piet Souris
  • Mikalai Zaikin

Access denied for user 'root@localhost' (using password:NO) error in MySQL

 
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,

This is regarding an error i get during the configuration of MySQL. If its not the appropriate forum, moderators please move this thread to the one.

I have been trying to install MySQL 5.0 in Windows XP. The installation was successful but during the final step of configuration i had been getting this error,

Error Nr 1045. Access denied for user 'root@localhost' (using password:NO).

I have been searching in google and mysql forums as well. As someone else suggested i have opened the TCP/IP Port 3306 (where MySQL gets installed as a service and listens to any connection request) through the Windows Personal Firewall (inside Control Panel) . I verified the same in command prompt through 'netstat -a' command also.

When the same issue arose in my home pc, i got it resolved through excluding the port through Personal Firewall

The only difference is i am inside a corporate network here at office.

Can anyone help me out in resolving this issue?

Am i missing something here?

Thank you in advance.
[ December 03, 2007: Message edited by: Raghavan Muthu ]
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Few quick things that I would check for are :


1. Is the current user a local admin on the box, else you wont have permissions to set the firewall (to the best i know)

2. Take an output of netstat - aon and see which process is binded to what .. If possible paste it here too

3. Did you give a password at the time of configuration ?

4. Are you able to do a telnet to port 3306 ?

Thanks
[ December 03, 2007: Message edited by: Bindesh Vijayan ]
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Bindesh,

Thank you so much for the quick attention. here you go..


1. Is the current user a local admin on the box, else you wont have permissions to set the firewall (to the best i know)



Yes very much. I do have the admin rights


2. Take an output of netstat - aon and see which process is binded to what .. If possible paste it here too



Here it is...

PROTO Local Address Foreign Address State PID
TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING 2296

Is that what you wanted?


3. Did you give a password at the time of configuration ?



Yes. As it asked me to enter the password during the last but one step.


4. Are you able to do a telnet to port 3306 ?



Yes. I was able to. It displays the following result.

A
5.0.45-community-nt♦*_~|uV-{,☻I:&L.@6.%kpm


Thank you.
[ December 03, 2007: Message edited by: Raghavan Muthu ]
 
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The "Access denied" error means that the connection is fine, but after you connect, you cannot authenticate.
Please check the MySQL install documentation for user setup (if I recall correctly, you need to specify both user and host, like "root@localhost")
in a users table.
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Edvins Reisons:
The "Access denied" error means that the connection is fine, but after you connect, you cannot authenticate.
Please check the MySQL install documentation for user setup (if I recall correctly, you need to specify both user and host, like "root@localhost")
in a users table.



Thank you Edvins. But we generally do NOT deal with the user table during configuration right?

The same worked in my home pc without any extra efforts. :roll:
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you found the install documentation ?
 
Sheriff
Posts: 22743
129
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Access denied for user 'root@localhost' (using password:NO).


The "using password:NO" means you are trying to connect without a password, or with an empty password. As you have set one in the setup, this is not allowed, and the connection fails.

Apparantly the installation itself ignores the password it has just set. If that's the case, it's a huge bug from the people at MySQL.
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Edvins Reisons:
Have you found the install documentation ?



Yes i did find and go through. Nothing new i found out in the documentation.
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rob Prime:

Apparantly the installation itself ignores the password it has just set. If that's the case, it's a huge bug from the people at MySQL.



I think you are right Rob. That's way it looks to me too though.

But still how come the same got resolved in my home pc but not here! quite confused and getting bugged off! I tried completing by NOT giving the password for root user.

The configuration was successful but i could not proceed further as my login to mysql was not getting in as i am not aware of the default password being set.

Any idea for this?
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Raghavan,

my experience about two months ago (same DB, same OS) was a quick
and easy installation process. And, according to the documentation
(see here), whether there is an initial password or not
depends on the installation procedure that you choose.
The documentation is, in my experience, accurate and detailed,
so you shouldn't have a problem reinstalling MySQL.

Good luck.
 
Ranch Hand
Posts: 893
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had the same problem a time ago. The problem was that mysql remembered an old password.

You can change your password in the following way


Resetting Permissions Mysql


Hope this helps.
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Edvins Reisons:
Raghavan,

my experience about two months ago (same DB, same OS) was a quick
and easy installation process. And, according to the documentation
(see here), whether there is an initial password or not
depends on the installation procedure that you choose.
The documentation is, in my experience, accurate and detailed,
so you shouldn't have a problem reinstalling MySQL.

Good luck.



Thank you Edvins. But i am sorry to say that its still of NO use! .
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Remko Strating:
I had the same problem a time ago. The problem was that mysql remembered an old password.

You can change your password in the following way


Resetting Permissions Mysql


Hope this helps.



Remko, Thanks a lot man

The link what you have supplied did really work! You deserve a beer for that

As i had never encountered this situation and also enabling the port using the Personal Firewall did resolve that.

Anyways, i have done as what they have suggested by storing the username and password for 'root' user in a .txt file and ran it in command prompt by specifying the --defaults-file and --init-file options. It did work!

Still i wonder how come the same got resolved in my home PC and not in my office PC until i did this work around?

Thank you again for helping me resolve a big issue!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic