Change root password of MySQL

To Change root Password of mysql you can change it by using

mysqladmin command.

if you want to change or update root password then execute this command

mysqladmin -u root -p’oldpassword’ password newpassword

For example, If old password is tejas, and set new password to tejasbarot, enter:

mysqladmin -u root -p’tejas’ password tejasbarot

if you want to change password of other user of MySQL then execute this command

mysqladmin -u <your-username> -p oldpassword newpass

Enjoy 🙂