If you are locked out of your Drupal admin panel, you can reset the password via command line (Drush) or directly in the database.
Reset via SSH
If you have SSH access and Drush installed:
cd ~/public_html && drush user:password admin "NewPassword123"
01. Method 2: Reset via phpMyAdmin
For Drupal 7:
UPDATE users SET pass = MD5('NewPassword123') WHERE name = 'admin';
For Drupal 8/9/10, the password hash is more complex. The easiest approach is to use the one-time login link: add /user/password to your site URL to request a password reset email.
If email is not working, generate a login link via Drush: drush user:login
Drupal 8 and later use bcrypt hashing, not MD5. The MD5 method only works as a one-time login trick on Drupal 7. For Drupal 8+, use Drush or the password reset email. After any MD5 reset, log in and change the password through the admin UI immediately.
For other CMS password resets: Joomla, osCommerce, Zen Cart.
Locked Out?
Open a Support TicketQuick Recap
- Drush:
drush user:password admin "newpass" - Drupal 7 DB: UPDATE users SET pass = MD5('newpass')
- Drupal 8+: Use /user/password reset link or Drush
- Change password again through admin UI after MD5 reset
- Back up before changes
CMS password recovery · Last updated March 2026 · Browse all PHP Scripts articles
