Reset admin password in Drupal 9

  1. Go to the base folder of the drupal installation
  2. Generate the hash for your password: php core/scripts/password-hash.sh 'newpasswd'
  3. Execute in mysql: UPDATE users_field_data SET pass='hash_result_from_previous_command_goes_here' WHERE uid = 1;
  4. Clear the cache: DELETE FROM cache_entity WHERE cid = 'values:user:1';