How to reset admin password if account is blocked I am using Drupal 8 and I forgot my admin password and have it blocked due to trying to login unsuccessfully 5 times. I am running my website in localhost.
How can I reset it? Is it possible to do with a SQL query?
Drush is ideal but if you don't have that installed, you'll need to do more than just a sql query because you'll need to get a hash of the password you want to use.

First find your core drupal main directory and run 

php core/scripts/password-hash.sh "your_new_password"


In phpmyadmin or your sql db manager of choice find the admin user in users_field_data and replace the pass value with the hash you got from the command above.

Then truncate the 'cache_entity' table. If you were locked out from too many failed login requests also delete instances of your IP in the 'flood' table.

Then you should be able to log in with your new password.