Last updated December 19, 2015. Created on January 10, 2006.
Edited by Michael-Inet, darol100, J. Cohen, batigolix. Log in to edit this page.

There are several methods to recover the Drupal administrator ("user 1") password. The fastest way is using drush for Drupal 7. For Drupal 8, DrupalConsole provide a suite of commands to recovery and manage users passwords.

Recover password with DrupalConsole (Only Drupal 8).

DrupalConsole offers several ways of recovering the administrator's password.

Generate login-link

DrupalConsole can generate a one-time login link.

drupal user:login:url

Reset password

drupal user:password:reset

Clear login failed attempts for an account.

drupal user:login:clear:attempts

Request new password via e-mail

You can reset your password by requesting a new password at http://www.example.com?q=user/password.

Change password with a database query

Drupal 7

Use drush for Drupal 7.
Update administrator password via sql-query in Drupal 7.

Drupal 6 and below

Execute the following query on the Drupal database where 'givememypasswordback' is your new password. You will need to log into your database using phpMyAdmin or another tool.

UPDATE users SET pass = MD5('givememypasswordback') WHERE uid=1;

Recover password with Drush

Drush offers several ways of recovering the administrator's password.

Generate login-link

Drush can generate a one-time login link.

drush uli

Reset password

drush upwd --password="givememypasswordback" "admin"

(where "admin" is the user name)

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

glinkap@gmail.com’s picture

How use this , when i use windows? where information about this?
not friendly process

i have d8