Tuesday, 23 August 2011

MySQL change root password

To change the root password for the database in linux you use mysqladmin utility. The parameters you need to pass are:
-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

0 comments:

Please rate this post