If you need to change the MySQL root user’s password use the following from a command prompt:
mysqladmin -u root -p password NEWPASSWORD
Enter the current root password when prompted and replace NEWPASSWORD with the desired password. This should return you to the command prompt, and you can test whether it was successful by logging in:
mysql -u root -p