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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mysql root issues

Status
Not open for further replies.

imryn

Programmer
Joined
Dec 2, 2002
Messages
75
Location
US
Hi All,

I am working on installing a mysql database verisn 3.23.49 on redhat 7.3. I finally have it up and running, that is I can start the mysqld. However, I can not log into the database as root. the message i receive is, ERROR 1045: Access denied for user: 'root@localhost' (using password: NO). I can log in as using mysql -u mysql, but I can't access the mysql table. Any suggestions would be great!!

Ryan
 
You have set a password on the root account. This is a good thing. Start mysql by:

mysql -p

and it will prompt for the password.

If you don't know the password, you can re-run the <mysql_dir>/scripts/mysql_install_db script to rebuild the mysql database. You might need to delete the <mysql_dir>/data/mysql directory to do this, but I'm not positive.

Since you've just installed the server this shouldn't disrupt any existing user/database relationships.


 
hi lgarner,

No, I have not set the password for root, that is my problem. If I run the mysql_install_db command to reset everything, which is okay to do. then how do I set the password? Is there a default password? When I enter nothing I get an error message that it can't connect. If I could only get in i could change it.

Thank you,
Ryan
 
OK, then I don't know. I'd try reinstalling the mysql db through the script. All I can think of is that something's messed up in there. "root@localhost" is specifically one of the users created at installation.

There's no default password- just running "mysql" when logged into the server as root should get you in.

The method to change the password is (as root):
"update mysql.user set password=password('newpass') where user='root';"

 
lgarner,

Thank you! I changed the password for root and it now works loging into. I have more more question, when I try to log in as " mysqladmin -u root -p password " then it asks for a password. So I type one in and it replies with " mysqladmin: To few arguments to change password " so my thought is do I need to log in as the Root this way? Or is this just another way to change the root password ?

Ryan
 
Try without a space between "-p" and "password".

mysqladmin -u user -ppassword

If you're logged into the server as "root", then the "-u root" is optional. Mysql will use the currently-logged-in userid unless told otherwise.
 
lgarner,

Thank you so much for helping me. I am up and running problem free for now... :-> ... thanks for having patience with me too...

Sincerely,
Ryan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top