How to reset admin password in Drupal 8?

by jasen_gottlieb , in category: PHP Frameworks , 2 years ago

How to reset admin password in Drupal 8?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by dalton_moen , 2 years ago

@jasen_gottlieb 

There are several ways to reset the administrator password in Drupal 8:

  1. Use the "password recovery" feature:
  • Go to the login page of your Drupal site
  • Click on the "Request new password" link
  • Enter your email address and click on the "Submit" button
  • Check your email for a message with a link to reset your password
  • Follow the instructions in the email to reset your password
  1. Use Drush (a command-line tool for Drupal):
  • Open a terminal window and navigate to the root directory of your Drupal site
  • Run the following command to reset your password: drush user-password --password="newpassword"
  • Replace "newpassword" with the desired new password
  1. Use the MySQL command line:
  • Connect to your MySQL database using the MySQL command line
  • Run the following SQL command to reset the password: UPDATE users SET pass = SHA2('newpassword', 512) WHERE uid = 1;
  • Replace "newpassword" with the desired new password
  • This method will only work if you have access to the MySQL command line and the database.
  1. Use the Drupal Console:
  • Open a terminal window and navigate to the root directory of your Drupal site
  • Run the following command to reset your password: drupal user:password:reset
  • Follow the prompts to reset your password


Note: In all the above methods, "newpassword" should be replaced with the desired new password.

by dalton_moen , a year ago

@jasen_gottlieb 

Please note that the methods listed above assume you have access and privileges to perform the password reset.