Forgetting or losing your password is never a pleasant experience, especially when its the admin password.
When your website is based on Drupal, periodic password resets enhances security.
Fortunately, Drupal has an advanced feature to reset the admin password easily. But, we often see errors with password reset due to specific modules, cache setting & much more.
At Bobcares, we often get requests from our customers to “reset admin password in Drupal” as part of our Server Management Services.
Today, we’ll see how our Support Engineers set up “Drupal reset admin password” & fix the related issues.
How to reset Drupal admin password?
Drupal stores its admin password in databases. Therefore, resetting admin password becomes easy with the help of database management tools like phpMyAdmin.
Let’s see how we reset the admin password in Drupal 6 via phpMyAdmin by following the below steps.
1. First, we log into cPanel.
2. Then, we go to the Databases > phpMyAdmin.
3. Next, in the left-hand pane of phpMyAdmin, we click the Drupal database.
4. After that on the top menu bar, we click the SQL tab.
5. We copy and paste the code into the SQL query text box.
UPDATE users SET pass = MD5( 'NewPassword' ) WHERE uid = 1;
6. Finally, we click the Go button to update the database with the new password.
Now, the user could log in to Drupal as the administrator using the new password.
Again, for experienced users, the password reset can be done easily from the MySQL command prompt too.
Common errors and fixes related to Drupal reset admin password
Even after resetting administrator password in Drupal, some users often see errors related to it.
Let’s take a closer look at what are the causes & how our Support Engineers fixed it.
1. Module & cache settings
Recently one of our customers reported us that after resetting admin password he could not access the site. It resulted in a “500 internal server” error. Also, the error log showed
PHP Fatal error: Call to undefined function intel_path_filter_type_to_arg() in /public_html/includes/menu.inc on line 814
This error happened due to active intel module & cache session.
So, our Support Engineers took the following steps to solve the error.
1. Initially, we logged in to cPanel.
2. Then we navigated to Databases > phpMyAdmin.
3. After that, we had to disable the module temporarily. For this, we chose the Database > MySQL tab & entered the query in the SQL text box.
UPDATE system SET status='0' WHERE name='intel';
4. Finally, we run the query to flush the cache.
TRUNCATE TABLE sessions;
TRUNCATE TABLE cache;
TRUNCATE TABLE cache_bootstrap;
TRUNCATE TABLE cache_block;
TRUNCATE TABLE cache_form;
TRUNCATE TABLE cache_image;
TRUNCATE TABLE cache_menu;
TRUNCATE TABLE cache_page;
TRUNCATE TABLE cache_path;
TRUNCATE TABLE cache_update;
TRUNCATE TABLE cache_views;
That fixed the error. Now the user could access the site without any failure.
2. Flood table issue
Similarly, after resetting the password & when you try to log in with the wrong admin password many times, Drupal will block the admin because of maximum wrong attempts.
Generally, Drupal stores the wrong attempts of password in the flood table.
To get around this problem, we unblocked the admin & cleared the data of flood table by running the command:
drush sqlq "DELETE FROM flood"
Then, we reset the password for the admin.
drush upwd --password="mypassword" "admin"
That’s how we fixed the problem.
[Having trouble after resetting admin password in Drupal? We’ll fix it for you.]
Conclusion
To be more precise, periodic reset of password in application software is a primary step in maintaining server security. Today, we saw how our Support Engineers reset admin password in Drupal and fixed the related issues.
0 Comments