If we forget administrator password in Drupal then it is very easy to recover it using Email or Drush. But situation get tougher when we don't have Drush and email notification enabled.
In this way only database update query is the best way but you must have database access for it.
Use the following query for Drupal 6:
UPDATE users SET pass = MD5('newpassword') WHERE uid=1;
And for Drupal 7:
Step 1: Execute the following commands from the command line, in the Drupal root directory:
./scripts/password-hash.sh newpassword
Or for Windows:
php .\scripts\password-hash.sh newpwd
But make sure that php path is right in the first line of /scripts/password-hash.sh file.
Step 2: Execute following query in database:
UPDATE users SET pass ='output_from_step1' WHERE uid = 1;
I hope this will help.
0 Comment(s)