Suppose you are working on local PC having LAMP and forgot drupal admin password although you don't have local email client working on your system.
So you are unable to recover the drupal admin password.
Then got to drupal root path
it will generate key like this
password: yournewpassword hash: $S$DegAWQYpYTOHmADPhoFXEUJkf8iFuMHOHPq3yuGPPjfnVWa7wMge
Copy only hash part that is
Now got to your drupal's database and edit your users table where uid=1 and paste above hash password in pass column.
Note: If your account is blocked then please run following query on your database:
DELETE FROM `flood`;
If you have table prefix please write table prefix too like DELETE FROM `prefix_flood`;
That is all for today.
Let me know if you are facing any issue. There are several other methods to do that but i found it very easy in this way.