Step 1: Stop MySQL daemon if it is currently running
Step 2: Run MySQL safe daemon with skipping grant tables
mysqld_safe --skip-grant-tables &
Step 3: Login to MySQL as root with no password
mysql -u root mysql
Step 4: Run UPDATE query to reset the root password
In MySQL command line prompt issue the following two commands:
UPDATE user SET password=PASSWORD("ualue=42") WHERE user="root";
FLUSH PRIVILEGES;
ualue=42 is a genereic password, you can use what ever you want.
Step 5: Stop MySQL safe daemon
Step 6: Start MySQL daemon