I have a Drupal website on my computer.
I forgot its password and I don't know how to recover it.
I can't send emails in my computer or localhost.
I read a lot of webpages about resetting the password in Drupal on localhost, but not working.
I have a Drupal website on my computer.
I forgot its password and I don't know how to recover it.
I can't send emails in my computer or localhost.
I read a lot of webpages about resetting the password in Drupal on localhost, but not working.
To reset you password use this command:
UPDATE users SET pass='$S$Cd059Vsxc8berFeg6hspaa7ejx2bSxyUisvCbT4h9o8XIgSUtPKz' WHERE uid=1;
This password is: password
To sent emails from XAMPP, use SMTP module: https://www.drupal.org/project/smtp
Just create a file "new_password.php" (or with any other name) inside your drupal folder and access it using browser. It will generate one way encrypted hash password for you.
<?php define("DRUPAL_ROOT", getcwd()); require_once DRUPAL_ROOT . "/includes/bootstrap.inc"; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); require_once "includes/password.inc"; echo user_hash_password("123456"); die(); menu_execute_active_handler(); ?>
When you run this code in browser it will show you hash password like
$S$D95YW4EejaUDPq5nZ7Z2Ljx1Ud4wlN1iTMQdAKton70JcQpCZmrG
Now you need to update your database table using above hash. Open your database using PHPMyAdmin or Workbench and run the below query.
UPDATE users SET pass = '$S$D95YW4EejaUDPq5nZ7Z2Ljx1Ud4wlN1iTMQdAKton70JcQpCZmrG' WHERE uid = 1;
Now you can access drupal using username as "admin" and password as "123456". Make sure you update password after login to the admin.
You can reset the localhost password using the drush
drush upwd --password="yourpassword" username
for eg: drush upwd --password="sweety" pragya
There is one more way to reset password using drush .
Just type
drush uli
.
This will give you one time password reset url for Admin.
Something like http://default/user/reset/1/1428579639/O1Rs12HxYZV7rrMUR7xuXhg9RDvsk9OFZ1-nVCoSVWU
Replace default
with your actual drupal URL and paste it in browser it will ask for new password.