Last Updated: February 25, 2016
·
1.77K
· highrockmedia

Use Drush to reset a password in Drupal 7

Sometimes when you are working on your local dev, you need to reset the password of your user. With Drush you can do:

drush upwd user --password="the_password"

... where "user" is the name of the user in the Drupal DB and "the_password" is your new password.

If you are doing this on a remote or live server you may want to do:

history -c

...after you do this.

2 Responses
Add your response

Keep in mind that the password will be visible in your shell history. Just to be safe, follow the drush upwd command with

history -c
over 1 year ago ·

Avoid passwords on the command line altogether by generating a one-time login link:

drush uli username
over 1 year ago ·