Skip to content

Resetting the Drupal administrator password

If you forget your Drupal administrator password, you can reset it directly in the database. On ruachost.com, this is done through phpMyAdmin or the MySQL command line.

  • Regain access to your Drupal site if locked out.
  • Resolve login issues caused by corrupted credentials.
  • Maintain site security by updating compromised accounts.
  1. Log in to your ruachost.com Client Area.

  2. Open phpMyAdmin.

  3. Select your Drupal database.

  4. Click the users table (usually named users_field_data).

  5. Locate the administrator account (typically uid = 1).

  6. Click Edit.

  7. In the pass field, enter a new password using MD5 encryption:

    MD5(newpassword)

    (Replace newpassword with your desired password.)

  8. Save changes.

  9. Log in to Drupal with the new password.

If Drush is installed, you can reset the password via command line:

Terminal window
drush user-password admin --password="newpassword"
  • Replace admin with your administrator username.
  • Replace newpassword with your desired password.
  1. Log in to your server via SSH.

  2. Access MySQL:

    Terminal window
    mysql -u username -p
  3. Select your Drupal database:

    USE drupal_database;
  4. Update the password:

    UPDATE users_field_data SET pass = MD5('newpassword') WHERE uid = 1;
  5. Exit MySQL and log in with the new password.

  • Always use a strong password to protect your site.
  • If you use Drupal 8 or 9, passwords are hashed differently; Drush is the recommended method.
  • Back up your database before making changes.