Drupal 8 → How to manually reset an admin password on CentOS
Published in
1 min readDec 16, 2016
This is a walk-through on how to reset an admin password in Drupal 8.
- Log into Mysql and go to your Drupal’s schema
- Find the users_field_data table
- Find the user that is related to you.
- Log into your terminal
- Go to your Drupal main directory
- Run this command
php core/scripts/password-hash.sh “NewPasswordHere”
Don’t forget the quotes in the above example
It will create a hash you can use in your database.
- Go back to your DB table
- Replace the pass value with your new hash. Save/update your table’s row.
- Go to flood table in DB
- If you are running a non-production server, simply truncate this table, otherwise look for anything that is flagging your IP with logging in. delete those records.
- Go to cache_entity table in DB
- If you are running a non-production server, simply truncate this table, otherwise look for anything that is flagging your IP with logging in. delete those records.
- Now you should be ready to log in with the new password. Go your login page on your site and try again!
Happy Coding!