Drupal 7 Password Reset


All of us have at one time or another forgotten our Drupal Installation password. After you’ve tried all those likely combinations, you still cannot login in. Isn’t that frustrating?

Here’s a simple way to reset the password assuming, you have access to the associated database.

First up, if you have shell access to your Drupal installation folder, then  open up the shell and browse to the Drupal root folder.

Next run this built in Drupal script to create the new password hash php .\scripts\password-hash.sh “newpassword” Replace  newpassword with the password that you’d like to set. Do NOT exclude the double quotes. Copy the password hash that you get after running the above command.

Resetting the password in the database

Step 1 Open phpMyAdmin and open the database associated with your Drupal Installation. Within the Drupal database, browse to the table named “users”.

Note: If you had setup a database prefix while installing Drupal, the table name will be “prefixname_users”.

Step 2 In the “users” table , find the row that has the admin user (or any user whose password needs to be reset) and click on “Edit” on that row.

 

Step 3 You’ll get a screen with several rows and columns. Find the row that has “pass” and in the “Value” Column of that row, delete the current value and paste the password hash (not the actual password) that you generated in the step above .

Step 4 After that click on the “Go” button to save the new password.

 

 

You can now login using your new password. Hope this post was helpful

 


Leave a Reply

Your email address will not be published. Required fields are marked *