You are here

Recover Your Super User Password On Your Local Machine

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.

  1. Open Database program (For me it was phpmyadmin for steps 1-6 and Sequel Pro for the remaining steps)
  2. Connect to mysql
  3. Choose a database that store the data for a site that you know the password 
  4. Select [your prefix]_users
  5. Click in the "pass" column of the "1" user
  6. copy everything in that field
  7. Choose the database that stores the information of the site you cannot log into
  8. Select [your prefix]_users
  9. Click in the "pass" column of the "1" user
  10. Select all and delete
  11. Paste the encrypted password from the previous users > pass field
  12. Try to log into your site

In my case these steps worked because both installations were encrypted the same.

Drupal on!!