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:
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:
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.
0 comments:
Post a Comment