Published by superadmin on Fri, 10/28/2011 - 09:15
The other day I was working on my Mac OSX 10.6 MacBook Pro. A very old model. I imported the database from a live site. When I tried to log in to the root/super user, I was not able to. The password would not work. My first thought was, "how am I going to recover my password?"
Why doesn't the password recovery work?
For me, my mac would not send out the email.
The link would not find my computer because the Drupal installation is only accessible from localhost
What do I need?
For these steps, you can use your favorite database editing program or terminal (I am on a Mac). I use Sequel Pro.
How to change the password?
First off, the password in the database is encrypted and Drupal requires that there is a password to log in.
Here is how to reset the the password
These steps are based on using Sequel Pro for each step. PHPmyAdmin is a little different.
- Open Database program (For me it was phpmyadmin for steps 1-6 and Sequel Pro for the remaining steps)
- Connect to mysql
- Choose a database that store the data for a site that you know the password
- Select [your prefix]_users
- Click in the "pass" column of the "1" user
- copy everything in that field
- Choose the database that stores the information of the site you cannot log into
- Select [your prefix]_users
- Click in the "pass" column of the "1" user
- Select all and delete
- Paste the encrypted password from the previous users > pass field
- Try to log into your site
In my case these steps worked because both installations were encrypted the same.
Drupal on!!