Created
February 16, 2015 11:22
-
-
Save gephaest/3019fe25a6ec916f79d3 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