-
-
Save felipepodesta/4988a825a6a27ebdb89ff7d477db0c0c to your computer and use it in GitHub Desktop.
Reset password for administrator in Drupal 7
This file contains hidden or 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 | |
define('DRUPAL_ROOT', getcwd()); | |
require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; | |
require_once DRUPAL_ROOT . '/includes/password.inc'; | |
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); | |
db_query('UPDATE {users} SET pass = :hash WHERE uid = 1', | |
array(':hash' => user_hash_password('PASSWORD_HERE')) | |
); | |
die(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment