Community Documentation

Recovering the administrator password

Last updated December 31, 2012. Created by jbrauer on January 10, 2006.
Edited by batigolix, rvanderh1, dkinzer, BassPlaya. Log in to edit this page.

There are several methods to recover the Drupal administrator ("user 1") password. The fastest way is using drush.

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

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 a number of methods to recover 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)

Update password with query

drush sql-query "UPDATE users SET pass = MD5('givememypasswordback') WHERE uid =1;"

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 4.5.x or older, Drupal 4.6.x, Drupal 4.7.x, Drupal 5.x, Drupal 6.x, Drupal 7.x, Drupal 8.x
Level
Beginner
Audience
Site administrators, Site builders
Keywords
admin, administration, password, recovery, site administration, user 1
Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here