When I attempt to login to my admin account, I'm getting a 'Sorry, unrecognized username or password.' message. The weird thing is that the password and username are correct. I've looked them up in the SQL database. I've even tried changing the password in the database, but have had no luck getting it to work. After every 5 attempts, I've had to use the DELETE FROM 'flood'; sql command in order to reset the attempts.

In my local environment, I'm having no trouble logging in. This is also the first time I've attempted to login to the production website.

Is there anything I can try to fix this?

2 Answers 2


If you changed the password in the database, it won't work - the password in the database is hashed, so entering an un-hashed password means it will never work.

Use the password recovery tool to get a new password, or use Drush:

drush uli

Either of these will help you get your password.


If you have access to the server through SSH there are 2 ways to get in:

With Drush: execute the following command from the root of your Drupal installation, or from the website folder in a multisite installation:

drush uli

Without Drush: execute the following command from the root of your Drupal installation:

./scripts/password-hash.sh my_new_password

Where my_new_password must be replaced with the password you want for your user. This will give you the following response:

password: my_new_password hash: $S$DYx387nLkjxnMiupTv8ubxxnixbF3d0QchC2zhw7Y5XvlO6KqZ0T

This means that $S$DYx387nLkjxnMiupTv8ubxxnixbF3d0QchC2zhw7Y5XvlO6KqZ0T is a hashed version of the string my_new_password and it is the value you must add to your user in the database.

I'm not totally sure if a text hashed in this way but in a different Drupal installation (your localhost) would work... just check it.

Now, if you don't have SSH access, you can always use the www.example.com/user/password form to recover the password for your account. It will work if your server can send emails and you have access to the email account associated with the user you want to recover.

  • Hey, thanks for the advice. I'm working on getting Drush installed on the server. Well... I have it installed, but I need to point it to the php directory on the server, which I've not found. Anyway, when I tried the "without drush" method, I got a permission denied error. Any ideas? Lastly, requesting a new password from user/password acts like it works, but it does not send an email. It seems everything is giving me trouble.
    – Kellen
    Commented Oct 4, 2016 at 2:15

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.