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.
- Right click on Computer > Properties > Advanced System Settings > Environment Variables....
- In the System variables section click on Path and click Edit.
- 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).
- Type Windows key + R > cmd.
- Type cd \
- Type cd c:\inetpub\vhosts\[domain]\httpdocs.
- 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 ?.
- Copy the output generated by the script which is the password hash for the site.
- Log into Plesk. Navigate to the subscription, Websites & Domains tab, Databases, click on the database, select Webadmin to launch phpMyAdmin.
- 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.
Article ID: 1856, Created: April 16, 2013 at 3:49 PM, Modified: July 19, 2015 at 11:36 AM