Skip to main content

How to reset admin password in Drupal7 ?


<?php  

define('DRUPAL_ROOT', getcwd());

require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
include_once DRUPAL_ROOT . '/includes/password.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

echo user_hash_password('aktel'); 

die();
and copy this hash code to your user pass filed; or run this query
UPDATE users SET pass='$S$CGM3hk.Fvl/pQlirfJmIQiXMOdifVR.wPoyT9e81ktxAStq7pmGK' where uid=1;

and now your password is aktel

or
run this query:
for D6 UPDATE users SET pass = MD5('aktel') WHERE uid = 1;

Comments