MySQL change root password

-u root the username used for logging in. In this case we want to be root obviously
-p'currentPassword' the password for logging in. Notice there are no space between p and quote.
password newPassword define the new password.
So for example:
mysqladmin -u root -p'myoldpassword' password mynewpassword
Comments