This article describes how to reset the Drupal administrator password.
Normally if you forget your password, you can use the Drupal password recovery feature to reset the password by e-mail. However, if this option is unavailable (for example, if e-mail on your site is not working correctly), there are other ways to reset the password.
The quickest and easiest way to reset an administrator's password is to request a new one through e-mail. To do this, follow these steps:
You can use the Drush command line tool to reset the administrator password (or the password of any other user). To do this, follow these steps:
drush upwd --password="NewPassword" admin
You can also modify the administrator password directly in the database using phpMyAdmin. The steps to do this depend on the version of Drupal you are running.
To manually reset the administrator password for Drupal 6, follow these steps:
UPDATE users SET pass = MD5( 'NewPassword' ) WHERE uid = 1;
UPDATE dr_users SET pass = MD5( 'NewPassword' ) WHERE uid = 1;
To manually reset the administrator password for Drupal 7, you must first generate a password hash. Then you can use phpMyAdmin to update the Drupal database with the hashed password. To do this, follow these steps:
php ./scripts/password-hash.sh "NewPassword"
In the left-hand pane of phpMyAdmin, click the Drupal database. A list of tables in the database appears.
Copy and paste the following statement into the SQL query text box. Replace HashValue with the hash string you copied in step 4:
UPDATE users SET pass = 'HashValue' WHERE uid = 1;
UPDATE dr_users SET pass = 'HashValue' WHERE uid = 1;
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.