Forgetting your MySQL password can be a real headache for you.Here are some easy steps that you can follow to recover MySql password under Windows
You have to stop MySql service before you proceed.In Windows environment, go to 'Task Manager' and Under 'Service' tab find MySQL and stop it.
All you need to do is to create a text file and put the below two lines into that.
UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
Save it under C:\ drive and give it a name 'mysql-init.txt'
Now it's time to restart your MySQl which you stopped in before but this time from command line.
C:\> C:\mysql\bin\mysqld-nt --init-file=C:\\mysql-init.txt
Now you can log in with your new password. When you finish remove the file that you created in the previous stage.