Bootstrap FreeKB - mySQL / MariaDB - Update a users password using the SET PASSWORD statement
mySQL / MariaDB - Update a users password using the SET PASSWORD statement

Updated:   |  mySQL / MariaDB articles

This assume you are able to log into your MariaDB or mySQL server or you have configured passwordless authentication and will be using the -e command line option. You may want to first SELECT USER to display the list of current users.

Here is one way to change a users password.

alter user 'john.doe'@'localhost' identified by 'new_password';

 

And here is another way.

UPDATE mysql.user SET Password=PASSWORD('new_password') WHERE User='the_username';
FLUSH PRIVILEGES;

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter a93fcf in the box below so that we can be sure you are a human.