dimanche 22 novembre 2015

Drupal 7! How to reset my admin password?


The best way to reset your admin's password if it was lost!
1- Create a php file named for example pass.php in your drupal root directory.
2- Paste this code into pass.php file:
<?php
include_once './includes/password.inc';
include_once './includes/bootstrap.inc';
$newPass = user_hash_password('yourNewPass'); //hashing password
echo $newPass;
?>
3- Navigate the file with exemple.com/pass.php then copy the output md5 pass.
4- Open your phpmyadmin interface, go to your database then the users table and alter the administrator user pass with the new md5 rendred password.
5- Finally log into your site with yourNewPass