Changing MySQL root password in CLI

Howdy,

There isn’t a simpler way on the command line using Virtualmin.

The way you found is the best way to reset the MySQL root password if you no longer have the original password.

Or, if you’re just looking to change the MySQL root password, and you still have the original one, you can use the mysqladmin tool to do that.

Something like this can do that:

mysqladmin -u root -p'oldpassword' password newpass