How to create encrypted hash passwords for drupal 7

M Arif picture M Arif · Apr 24, 2014 · Viewed 7.1k times · Source

After searching over internet I came to know that With drupal 7, password are no more encrypted through md5.

What are possible ways to get passwords encrypted in Drupal 7??

Answer

Malik Shahzad picture Malik Shahzad · Apr 24, 2014

With drupal 7, password are no more encrypted through md5. There are several way to get/set a password in drupal7. Using drush (for your information, not used in your case):

drush upwd admin --password="newpassword"

Without drush, if you have a cli access to the server : (for your information, not used in your case)

cd <drupal root directory>

php scripts/password-hash.sh 'myPassword'

Now copy the resultant hash and paste it into the query:

update users set name='admin', pass='pasted_big_hash_from_above' where uid=1;