MySQL Change Root User’s Password using mysqladmin

For the first time to set new password use :
  • $ mysqladmin -u root password 'PASSWORD'
     
For changing from old password use
  • $ mysqladmin -u root -p 'OLDPASSWORD' password 'NEWPASSWORD'