Page 1 of 1

Change mysqladmin password?

Posted: Mon 21. Dec 2020, 02:50
by LastSavingGrace
Hello,

Is it possible to change the mysqladmin password? I tried:

Code: Select all

UPDATE mysql.user SET authentication_string = PASSWORD('newpass')
WHERE User = 'mysqladmin' AND Host = 'localhost';
FLUSH PRIVILEGES;
The affected rows was 1, but the login fails.

Thank you.

Re: Change mysqladmin password?  [SOLVED]

Posted: Mon 21. Dec 2020, 08:19
by Alexander
Hello,

this is not the SQL how one would update the password.

Use this instead:

Code: Select all

UPDATE `mysql`.`user` SET `Password` = PASSWORD('newpass') WHERE `User` = 'mysqladmin';
FLUSH PRIVILEGES;

Re: Change mysqladmin password?

Posted: Wed 23. Dec 2020, 01:58
by LastSavingGrace
Perfect, thanks Alexander. Not sure where I got that other code from.

Merry Christmas.