drupal · February 13, 2012 0

Change drupal 7 password using database

create new file “password.php” on root dir and add following code

define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
require_once DRUPAL_ROOT . '/includes/password.inc';
echo user_hash_password('test'); 

run password file i.e drupal/password.php

copy the output and go to database open users table
replace existing password with output and relogin