Monday, 19 October 2015

Drupal Hosting Tips: How to Reset Password in Drupal 7?

Leave a Comment
Password resets have always been a problem with Drupal 7. Normally the password reset link goes to a landing page telling you to alter you password, then it directs to the user account edit page and doesn’t force the user to modify their password. so what happens is that they never end up changing their password to something they’ll bear in mind and that they keep requesting a replacement password reset link. This module replaces that landing page with the password reset form:

Drupal Hosting Tips: How to Reset Password in Drupal 7?

In order to reset Drupal 7 administrator password you'll ought to follow the steps described below:
Make a copy of index.php file in your Drupal directory and add following code after the line “drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);”:
require_once 'includes/password.inc';
echo user_hash_password('your_new_password');
die();


Now, look at the following picture:



Open the copy of the index.php file with the newly additional code. you'll notice a newly generated hash key that you'll need to use within the database, see the image below:


The generated code is a hash code of a password "your_new_password".
You should save the generated code & access your database. Using shell you can change the password by using following sql query:
UPDATE `your_drupal_database`.`drup_users` SET `pass` = 'hash_code_you_generated' WHERE `drup_users`.`uid` =1;

If you want to change the password over the phpMyAdmin you will need to find table called “drup_users” and insert new hash code into the field “pass” for your administrator user. See the following picture:

Drupal Hosting Tips: How to Reset Password in Drupal 7?


Finally, save the entered data to change your password and remove the copy of index file to finish the setup and use your new password to login to your administration panel.

Drupal 7 Hosting Recommendation

HostForLIFE offers you the latest Drupal 7 version hosting with unlimited domain, unlimited diskspace and bandwidth. With the 1-click Plesk Panel tool installer you will have installed Drupal 7 in a couple of minutes with no complex settings and necessary technical skills. To see more information, you can go to our review.

HostForLIFE

0 comments:

Post a Comment