0

I loaded a DAMP stack onto my MacBook Air, and started creating a Drupal 7 site. I decided to log out to see what things looked like while I was logged out, and when I tried to log back in, I was denied!

I started by asking the site to send me a recovery email, but it seems like my locally hosted site doesn't have that capability for whatever reason.

So I went into phpMyAdmin, wondering how I could have forgotten my password, which I had written onto a sticky note which I stuck to my desk several hours ago, which was now staring me in the face.

I went to the "users" tab for my site, found that my password was a big hash. I Googled what kind of hash phpMyAdmin uses to talk to mySQL, and discovered (I think) that I should be using MD5.

I found an MD5 hash generator on the web, entered my password into it, got my hash string, stuck it in the password slot for my account in phpMyAdmin, and tried out my password on my site.

Still no dice.

Then I tried shoving my password into phpMyAdmin without having hashed it. Still no good. Then I tried entering the unhashed password into the password field for my account in phpMyAdmin, and then going to edit>pass>dropdown:password... which have me a different hash from MD5... but still didn't work.

Then I tried something else, and got this:

Sorry, there have been more than 5 failed login attempts for this account. It is temporarily blocked. Try again later or request a new password.

It's been about 2 hours since I went from gleefully learning how Drupal theming works to being frustrated about logging into my own site. Can anyone help me?

2 Answers 2

3

If you have drush installed you can reset the password using:

drush upwd admin --password=admin

this will reset the password of the user with username admin to have the password admin. You can change the password of any user using this command with Drush.

P.S - Make sure you are in your site's directory while using this command.

If you don't have Drush installed, I recommend you to install it. Please see Specific instructions for installing Drush on different platforms.

After you've done with this, use the method @SoniKishan has mentioned to let Drupal allow you to login again.

2
  • Thanks for the advice. I wasn't able to get drush to operate the way that you described, but I did find a solution to my overall problem. I copypasted my site files after reloading a bran new stack. I know this wouldn't have been a good solution if I had a live site running on the web. In any case, I'm going to keep researching drush to figure out what went awry. Apr 25, 2013 at 17:23
  • @MichaelNail The drush command should work fine. I'm not sure how does it work on a mac, maybe you could try replacing the alias upwd with the proper command user-password.
    – Ajit S
    Apr 26, 2013 at 5:28
0

The quick solution is login in your database mysql -u <username> -p<password> or drush sql-cli

and execute this query

truncate flood;

and you'll able to login again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.