When, in Drupal 7, the password for user 1 (the administrator) is lost and the email notification or drush methods don't work, it is possible to set the password via a database query.
But 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 root directory:
go to your drupal home folder, probably /var/www/drupal-7.22
./scripts/password-hash.sh newpwd
Check the first line of this script. It will read something like #!/usr/bin/php. Confirm that the filename listed in this line is located on your machine. Typically if /usr/bin/php is not available, then /usr/local/bin/php will be.
or for Windows:


php .\scripts\password-hash.sh newpwd

0 comments

Popular Posts

无觅相关文章插件,迅速提升网站流量