It happens to all of us ... we lose our password.
Actually recovering your original password in Drupal 7 is not possible, but resetting one is possible and we're going to show you how to do it.
Your first step should be to try and reset your password by adding this to your site's URL: /user/password/. If that doesn't work or if you don't know the email for the account, then you can use this tutorial.
Drupal 6 vs Drupal 7
Resetting your password was easier in Drupal 6 and is explained in this tutorial.
Drupal 7 uses a more powerful 128bit encryption called sha512. In this tutorial we will show you how to generate the encrypted form of the password, which you an then paste into the data base and change the password "hard" way.
Step 1: Create a short PHP script
This method uses a short PHP script. The code is below. First thing to do is copy this to your clipboard exactly as it's written. Paste this into a text or script editor and then save it with an arbitrary and random name. If you use a plain language name it will give you an error message telling you to rename it with a random string., and be sure to remove this file from your server immediately after you use it. This is a big security risk since anyone accessing this could change your administrator password.
Step 2: Load the PHP script to your main Drupal Directory
Step 3: Use the PHP script from your browser address bar
Here's what they look like with the comment marks removed.
Step 4: Uninstall the PHP script and login
With Admincredible you can update and manage all your Joomla sites. If you have 5 or 500 sites, Admincredible will make your life easier! Visit Admincredible.com.
All of our tutorials are published under the Creative Commons Attribution-NonCommercial license. This means: