konrad_firm
konrad_firm

Reputation: 867

MySql resets user password after restarting mysql server

Well, actually it is mariadb, but to start its client, I need to enter "mysql" in command line.

Anyway, after entering

mysql  --user=root

Note, that at this time "root" doesn't have a password, so I successfully login and then:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('my_pass');

And it works, from now on I have to use "my_pass" to login.

But then I do:

sudo service mysql restart

And from now on, root's password is again reseted to "no password at all".

And again, to login I can't give any password.

Googling this doesn't help, because most articles are about "how to reset user password" :)

Upvotes: 1

Views: 1129

Answers (2)

Mohammed Thalha
Mohammed Thalha

Reputation: 1

I am using MacBook M2, I just uninstalled the MySQL server and then it works fine.

Upvotes: 0

konrad_firm
konrad_firm

Reputation: 867

Well, I managed to solve my problem - if anybody's interested you have to do:

flush privileges

After changing passwords.

Upvotes: 1

Related Questions