There are loads of ways to reset a forgotten MySQL root password. Here is my favourite method.
Log into the server
Elevate to root run the command below (the & is important):
service mysql stop
mysqld_safe â€“skip-grant-tables &
Use the following statements to reset the password. As an example we will use the password changeme but you should choose something secure.
update user set password=PASSWORD("changeme") where User="root";
service mysql start
The password has been reset. Ensure you change it if you used the example above rather than setting your own.