It’s has been happening, that we tend to forget password on local as well for the live site. When it’s come to Drupal 8 all things has things changed from the prior version of Drupal.
Here we go with some of the tricks for Drupal 8.
Generate a new password
First, you have to generate a password hash that is valid for your site.
Execute the following commands from the command line, in the Drupal 8 root directory:
$ php core/scripts/password-hash.sh ‘your-new-pass-here’
password: your-new-pass-here hash: $S$EV4QAYSIc9XNZD9GMNDwMpMJXPJzz1J2dkSH6KIGiAVXvREBy.9E
Update the user password.
Now you need to update the user password, in our case, we need to update the Administrator password, fortunately, the UID for Administrator is 1 equal to previous versions of Drupal.
With the new password, we need run the following SQL statement.
UPDATE users_field_data SET pass=’$S$E5j59pCS9kjQ8P/M1aUCKuF4UUIp.dXjrHyvnE4PerAVJ93bIu4U’ WHERE uid = 1;
We all set with password update and go… log in!