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

setting up password on mysql

Status
Not open for further replies.

dustervoice

Technical User
Apr 2, 2009
56
0
0
GB
im attempting to set the password for the first time in mysql and im recieving the following message .. "to few arguements to change password" my syntax is below.. any ideas?

mysqladmin -u root password 'my_password'
 
Thanks but that show how to create a new user.. im not trying to create a new user im just setting the ROOT account password for mysql
 
Invariably you still need to tell the tool to do on which host (-h part in the reference). Its form remains the same assign or change.
 
hmm this is the new syntax below and im still getting the same message. too few arguements...

mysqladmin -u root -h localhost password "mypassword
 
Changing root you definitely need old password to authenticate. Sorry for my not being fluent on this.
[tt] shell>mysqladmin -u root -poldpassword password "newpassword"[/tt]
 
ok so ive set the new password.... now it wont allow me to log in with it... wow this is frustrating...
 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: Y ES)



thats the error im receiving now and im typing in the correct password. i tried unistalling mysql but it seems to still keep the old password....
 
I just change the root password, login and then change back the root to original password, login: seems work as expected. I cannot ascertain the cause of your grieve, not right away. In the meantime, should you not record exactly you command for the change of passward? (your new password seems containing a lot of whitespace in it? is it a good idea?!)
 
Ok thanks for you help so far but at the stage i want to completly erase everything relating to mysql in centos.. i did the yum erase mysql-server mysql php-mysql but its seems that the password is still there when i reinstall how do i do a clean/full removal of mysql in centos
 
Remove the data directory. On Redhat systems it's normally in /var/lib/mysql. You can also delete /etc/my.cnf, which is probably still there also.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top