Losing or forgetting your Drupal admin password is one of the worst things that can happen. It can be so frustrating when you have to update your Drupal site then you suddenly find out that you can’t login, thereby locking you entirely out of your own site.
The first thing that you must do is to go to user/password and request for a new password. However, this approach won’t work if:
If any of the above conditions apply to you, then you can try the two methods that will be discussed in this short guide. The first one resets the password for user1, while the second one recovers it. For both, you’ll need mySQL database access, but only the first entails the execution of a mySQL function.
Reset Your Password
To change the password for, follow the steps below:
UPDATE users SET pass = md5(‘newpword’) WHERE uid = 1;
Note that you may have to use “SET password” instead of “SET pass” for earlier installations of Drupal.
Click on GO to execute the SQL query.
Retrieve Your Password
You may use this method if the second condition mentioned above applies to you. If you cannot retrieve your password because the email that you used for your user1 account is no longer in use, you simply have to update and enter a new working email address in the email field found in the “users” table. Once you’ve done this, navigate to the request password page so that you can have your existing password emailed to you.