How to Reset the Drupal Administrator password with a SQL Query in Drupal 7

How to Reset the Drupal Administrator Password with a SQL Query in Drupal 7 on a Windows Server
 
If you are unable to retrieve the administrator password using the email link the following process can be used to retrieve the password. Note: Dedicated server customers are able to perform this task. Shared hosting customers must contact support for assistance with retrieving their password.
 
  1. Right click on Computer > Properties > Advanced System Settings >  Environment Variables....
  2. In the System variables section click on Path and click Edit.
  3. Add ;C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP53 to the system path (or modify path for the specific version of php being used by domain). 
  4. Type Windows key + R > cmd.
  5. Type cd \
  6. Type cd c:\inetpub\vhosts\[domain]\httpdocs.
  7. Enter php .\scripts\password-hash.sh newpwd where newpwd is the new password you want to use. Avoid using special characters like a space, * or ?.
  8. Copy the output generated by the script which is the password hash for the site. 
  9. Log into Plesk. Navigate to the subscription, Websites & Domains tab, Databases, click on the database, select Webadmin to launch phpMyAdmin.
  10. Execute the following query on the Drupal database. The string within the single quotes is the password hash generated in step 7.
     
    UPDATE users SET pass ='$S$CTo9G7Lx28rzCfpn4WB2hUlknDKv6QTqHaf82WLbhPT2K5TzKzML' WHERE uid = 1;
     
If you have reset the password but still receive "Sorry, there have been more than 5 failed login attempts for this account. It is temporarily blocked." you should delete the corresponding entry in the flood table. The flood table records user name and IP addresses from which failed login attempts have occurred.  
 
 

Add Feedback