How to Change or Set New Root Password for Mysql DatabaseFor Mysql database, the system administrator user is called as root user. You can use the mysqladmin utility from a command line to change or set to a new password. Notice that there are two commands to be run.
mysqladmin -u root password "newpassword"
mysqladmin -u root -h host_name password "newpassword"
Mysql Set New password example:
mysqladmin -u root password ghtrj23%nh&
mysqladmin -u root -h localhost password ghtrj23%nh&
Run the below command to restart your Mysql database server to take effect for the password change. the next time you login it will prompt for you the New Password
Mysql Database Restart Command
sudo /etc/init.d/mysql restart