Last active
December 18, 2015 04:18
-
-
Save cdnsteve/5724222 to your computer and use it in GitHub Desktop.
Place this in your /root drupal directory. Change NEWPASSHERE to the new password for the root user.
run yoursite.com/drupal-password-reset.php
Take the output new password hash then go into MySQL and enter it, replacing: PASSWORDHASHOUTPUT
This updates the admin user account to the new password.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Resets password, copy this into Users table in MySQL | |
* Drupal 7 | |
*/ | |
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('NEWPASSHERE'); | |
die(); | |
menu_execute_active_handler(); | |
/* | |
* this gives hash then run: | |
* UPDATE users SET pass ='PASSWORDHASHOUTPUT' WHERE uid = 1; | |
* If blocked by temporarily blocked run this: | |
* DELETE FROM `flood`; | |
*/ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment