Drupal 8 → How to manually reset an admin password on CentOS

Tony Mucci
Dec 16, 2016 · 1 min read

This is a walk-through on how to reset an admin password in Drupal 8.

  1. Log into Mysql and go to your Drupal’s schema
  2. Find the users_field_data table
  3. Find the user that is related to you.
  4. Log into your terminal
  5. Go to your Drupal main directory
  6. 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.

  1. Go back to your DB table
  2. Replace the pass value with your new hash. Save/update your table’s row.
  3. Go to flood table in DB
  4. 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.
  5. Go to cache_entity table in DB
  6. 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.
  7. Now you should be ready to log in with the new password. Go your login page on your site and try again!

Happy Coding!

Code Kings

Proramming tips & tricks from professionals

Tony Mucci

Written by

Co-Founder of Eklect Enterprises • Founder of My Company Tools • Co-Founder of Dree

Code Kings

Proramming tips & tricks from professionals

More From Medium

More on Web Development from Code Kings

More on Web Development from Code Kings

Magento → “One or more indexers are invalid.

Tony Mucci
Feb 26 · 2 min read
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade