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.
Why Reset the Admin Password?
Section titled “Why Reset the Admin Password?”- Regain access to your Drupal site if locked out.
- Resolve login issues caused by corrupted credentials.
- Maintain site security by updating compromised accounts.
Steps to Reset the Admin Password
Section titled “Steps to Reset the Admin Password”Method 1: Using phpMyAdmin
Section titled “Method 1: Using phpMyAdmin”-
Log in to your ruachost.com Client Area.
-
Open phpMyAdmin.
-
Select your Drupal database.
-
Click the users table (usually named
users_field_data). -
Locate the administrator account (typically
uid = 1). -
Click Edit.
-
In the pass field, enter a new password using MD5 encryption:
MD5(newpassword)(Replace
newpasswordwith your desired password.) -
Save changes.
-
Log in to Drupal with the new password.
Method 2: Using Drush
Section titled “Method 2: Using Drush”If Drush is installed, you can reset the password via command line:
drush user-password admin --password="newpassword"- Replace
adminwith your administrator username. - Replace
newpasswordwith your desired password.
Method 3: Using MySQL Command Line
Section titled “Method 3: Using MySQL Command Line”-
Log in to your server via SSH.
-
Access MySQL:
Terminal window mysql -u username -p -
Select your Drupal database:
USE drupal_database; -
Update the password:
UPDATE users_field_data SET pass = MD5('newpassword') WHERE uid = 1; -
Exit MySQL and log in with the new password.
Important Notes
Section titled “Important Notes”- 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.