Recovering lost user (admin) password
[ src: https://www.drupal.org/node/44164 ]
Drupal 6
UPDATE users SET pass = MD5('givememypasswordback') WHERE uid=1;
Drupal 7
php ./scripts/password-hash.sh newpwd
The script will output a password hash that is valid for the site, something like:
$S$CTo9G7Lx28rzCfpn4WB2hUlknDKv6QTqHaf82WLbhPT2K5TzKzML
Use it in a SQL query to set new passwd:
UPDATE users SET pass ='$S$CTo9G7Lx28rzCfpn4WB2hUlknDKv6QTqHaf82WLbhPT2K5TzKzML' WHERE uid = 1;
Reset using a PHP-file
No command-line access? You can reset the drupal password using a PHP-file as well, but keep in mind that this opens the potential to a huge security issue if not handled correctly.
Clear flood table
If you have reset password but still receive “Sorry, there have been more than 5 failed login attempts for this account. It is temporarily blocked.” then you may delete the corresponding entry in the flood table.
This flood table records username and ip which has failed login attempts.