Change mysqladmin password?  [SOLVED]

Locked
User avatar
LastSavingGrace
Posts: 24
Joined: Wed 9. Dec 2020, 17:45

Change mysqladmin password?

Post 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.
User avatar
Alexander
Keyweb AG
Posts: 3810
Joined: Wed 20. Jan 2016, 02:23

Re: Change mysqladmin password?  [SOLVED]

Post 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;
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
User avatar
LastSavingGrace
Posts: 24
Joined: Wed 9. Dec 2020, 17:45

Re: Change mysqladmin password?

Post by LastSavingGrace »

Perfect, thanks Alexander. Not sure where I got that other code from.

Merry Christmas.
Locked