Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

re-installing mysql server 5.0-cannot log in as root!! 1

Status
Not open for further replies.

sapatos

Programmer
Jan 20, 2006
57
0
0
AU
Hi, I messed up my previous install of mysql server 5.0 as I didn't specify a password for root, thinking it would make things easier. I've since learned for netbeans connections i have ot specify a user so have tried to re-install the server. Now I'm getting the following error whilst configuring it.

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

it also mentions:

"...the data directory was not removed automatically.." and states i would need to use the old password. however if i try to change root password it fails.

can someone suggest how to perform a complete uninstall so i can start afresh. i ran this install on another machine with a root password and it worked a treat.

thanks
 
Just fire the server up with the skip-authentication option. Then, use the GRANT statement to define a decent password for your root user. Do not forget "WITH GRANT OPTION", otherwise your root user cannot grant rights to other users.

+++ Despite being wrong in every important aspect, that is a very good analogy +++
Hex (in Darwin's Watch)
 
thanks for that - next quesiton might be what is the syntax. I've had a look through the docs and can't find skip-authentication on the mysql site.
 
I am having a similar problem.

Running as root on a RedHat Enterprise distribution. I run rpm -i on both the client and server packages. Then I run mysql_secure_installation. When it prompts for current password for root, I just hit enter and get:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

At this point, I have done NOTHING other that to install the RPMs. How am I getting this error?

Note that a similar error results if I run the mysqladmin -u root password 'mynewpw' command.

Help!
 
Then I run mysql_secure_installation.

My crystal ball is broken again. What does that do?

Anyway, things that can cause access denials are changes in my.cnf, or changes to the grants in the database itself.

It is good to know that "localhost" is not the same as "127.0.0.1" when connecting to mysql. If the magic word "localhost" is used, the connection is done through a socket file and not over tcp.

Hope this helps.

+++ Despite being wrong in every important aspect, that is a very good analogy +++
Hex (in Darwin's Watch)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top