Submitted by
Dmitro
on
For Drupal 7
restore admin password
drush sqlq "select name from users where uid=1"
Once you know the name, you can reset the password as follows:
drush upwd admin --password=pass
For Drupal 8+
drush user:password site-admin "password"
UPDATE ALL USER PASSWORDS TO ADMIN PASSWORD
drush sql-query "UPDATE users_field_data set pass=(SELECT pass FROM users_field_data where uid=1) WHERE uid <>1"
After this need to clear cache:
drush cr
Possible You'll need to do this:drush sql:query "TRUNCATE TABLE flood;"