We can change the mysql root password from the WHM by using the steps provided at WHM DOCS but if server is not having control panel or not having WHM access then refer to the following steps to reset the mysql root password.
First make sure that mysql service is stop
Now run the following command from the shell.
If the above command runs successfully then refer to the following command.
/usr/bin/mysqld_safe –skip-grant-tables &
mysql -u rootmysql> use mysql;
mysql> update user set Password = PASSWORD(‘supp0rt123′) where User=’root’;
Now restart the mysql service