changing MySQL user and password
Just did a fresh install of MySQL (latest version) onto Redhat Linux 7.2, and it installed great from the server and client RPM files. Only problem is i tried changing the root password like in the tutorial from here:
mysqladmin -u root password "newpassword"
and i get back an error:
"error: 'Access denied for user: 'root@localhost' (Using password: NO)'
so i tried:
mysqladmin -u root -p password
and it asks for a password then, and i enter one, and once again i get the same error as before:
"error: 'Access denied for user: 'root@localhost' (Using password: YES)'
Tried all sorts of variations with mysqladmin password setting (with root as username and without, etc) and each time i get this access denied error. This is a fresh install (tried several fresh installs in fact), everything seems to work but this, it's like root doesn't exist to mysql or have access to change passwords for some reason. Any ideas?
Ahh, think I found the trick
For some reason it wants me to be very specific when using any mysql commands as to what server i'm talking about by using the -h command line option. This appears to work setting the root password:
mysqladmin -u root -h localhost.localdomain -p password "newpassword"
and now I can look at databases and use mysqladmin stuff if i add that -h bit like so:
mysqladmin -u root -h localhost.localdomain -p version
just posting this so if anyone else runs into the same problem maybe this will help them.
reset password ? start over
I to am having this trouble. I can access mysql and delete a database, but when I try and add one it says not for annon. users.
When I try to login with what I thought my password was it give me the same responces as above. I'm using os x. I thought I did in fact set the original password.
Is there a way to veto this password, or globally reset it, I have no data I need in my system, it was just set up to learn on, but uninstalling and reinstalling seem awfully challenging in and of itself.
Any help will be greatly appreciated as I am eagerly waiting to be able to go through my new book "kevin's" using php and mysql, but I can't create my first db. Cheers
I think I have the password I just cant login?
after performing a
mysqladmin -u root -p status
and entered the password it gave me a status report which leaves me to believe that I have the correct root password, but I can't login as a user to work with the database, any advice here? In os x you set up a user as mysql??? If that help at all