Categories

Featured templates

Drupal. How to reset admin login details

Phil Nowak July 10, 2012
Rating: 5.0/5. From 1 vote.
Please wait...

In this tutorial you will learn the way to change admin password in case you have problems locating it.

1) First of all you should create new file and put the following script in there:


<?php
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
 
require_once 'includes/password.inc';
echo user_hash_password('admin');
 
die();
menu_execute_active_handler(); ?>

Replace ‘admin’ with the password you need.

2) Save this file as php file on your server, in Drupal root folder, e.g. reset.php

3) Now open this file on your server at http://wwww.yourwebsite.com/reset.php and you should get hash code similar to this one:

$S$DMNPfKMxzmGB6wQZtxuVDF3uSqZef8aBRrUJLKfJHdXwfaUjh3zB

4) Copy the code and open your PHPMyAdmin tool, browse “Users” table, then you need to edit ‘admin’ entry:

Paste your new hash code into “pass” field and save the changes:

5) Now open your website and enter new password – it will work properly.

And the most important – you should remember that your website is not secure until you change password in admin panel

Feel free to check the detailed video tutorial below:

Drupal. How to reset admin login details

Best Drupal Templates
This entry was posted in Drupal Tutorials and tagged details, drupal, login, reset. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket