Driver Robot automatically downloads the latest drivers for your PC and keeps it running smoothly. Inject new life into your old PC and fix existing problems instantly. Run a free driver scan now and put your PC back in business.
As a preferred visitor, you can get $50 off of any Dreamhost hosting plan by using coupon code CWD50 when you check out, for a limited time. Dreamhost is a reliable hosting provider with solid customer service and a proven track record.
There's nothing more frustrating than updating your Drupal site only to be unable to login, and not having your admin password, therefore effectively locking you out of your site entirely. The first thing to try is to click on the lost password link, and have the password emailed to you. There is, however, a couple scenarios where this will fail to work:
In these cases, there are two ways to regain access to your Drupal site. The first resets your Drupal admin password (the password used by user 1), the second retrieves it. You'll need access to your mysql database (via phpMyAdmin, for example) for both methods, but only the first one involves executing a mySQL function.
To directly reset your password, log into phpMyAdmin and execute the following mySQL statement:
UPDATE users SET pass = md5('newpassword') WHERE uid = 1;
Enter your new password in the md5 function - it will automatically be converted via a one-way hash (this is why we can't retrieve your old password - the decryption is a one-way process). Note that for earlier versions of Drupal you may need to use SET password, instead of SET pass.
This will effectively reset the Drupal admin password for user 1. Note that you can use this to reset the password of any user, although this is typically unnecessary as you should be able to simply log in as admin user (user 1), under which you have the ability to reset any user's password.
An alternative to resetting the password is to retrieve it. This method only applies to the second problem above, that is, you are able to access the retrieve password page, but you're email address is outdated. To do this, simply update the email field for the admin user (user 1) in the "users" table. Unlike the password field, you can directly edit the email field without consequence. Once you've updated your email address for the admin user, simply go to the request password page to have your password emailed to your email address.
All Content © 2005 - 2010 Contract Web Development, Inc. All Rights Reserved. Privacy Policy | Terms of Use | Powered by Drupal
Thank you so much.
Thank you so much.
Thank you
Thank you! Whew this saved my day! Possibly my week!
Yet another reason why md5 should not be used any more
It should NOT be that easy to break in to a piece of software. Just another reason why md5 shouldn't be used anymore! Perhaps newer versions of Drupal are more secure?
In out of the cold
I got in, climbed through the window and am now drinking tea by the fire.
Created a new password and converted to md5 (never heard of md5 till today!).
Put the new password in the user table against administrator using myPHP and logged in.
sweet.
I'm still out in the cold - can't login...
I hope this thread hasn't gone too cold, my little face lit up when I saw it as I'm struggling to login to a new Drupal site I've just migrated to new hosting.
I don't have the admin login details so I used myPHP to change the administrator email address to my own, sent a password reminder - but when I send myself a reminder I get this message:
'warning: file_get_contents() [function.file-get-contents]: Filename cannot be empty in /home/example/public_html/www.mydomain.net/modules/mimemail/mimemail.module on line 398.'
But it does send the reminder email, which when i click the link to one-time login, doesn't work and says:
'You have tried to use a one-time login link which has either been used or is no longer valid. '
So I tried changing the password to each of the hashed passwords in the reply 'In a couple of clicks' above and that didn't work either.
Can anyone offer help or guidance?
J.
How is it possible?
Just amazing.
THANKS
Very useful bit of code, many thanks!
Thx
Thank you.
md5 translation
I was editing directly into the user pass field over and over again. Even went to this site so I could type my pass and get the md5 translation and enter that. So frustrating. I just executed your example and was done in 2 seconds. grrr. Thank you.
In a couple of clicks
In phpMyAdmin go to your drupal database, click on users. Find the user called admin, check the box then click the change icon. In the "pass" field you'll see a long string of characters the MD5 hashed password.
Set the password to a known value:
- password = "this is the MD5 hashed password"
------------------------------------------------------
- admin = 21232f297a57a5a743894a0e4a801fc3
- secret = 5ebe2294ecd0e0f08eab7690d2a6ee69
- OU812 = 7441de5382cf4fecbaa9a8c538e76783
Paste the hashed password into the field, save the change, and log-in using the new password.
Immediately change your password to something more secure!
Phew!!! saved a lot of headaches
Thanks for the great tip. I just started working with Drupal. I have the development install on my laptop with MAMP and forgot my password. The MD5 hint worked like a charm.
-Naveen
Saved the day
Thanks so much.
I've been working in a virtual machine without a mail server and needed to reset the admin password. This did the trick nicely.
- Andy
Really very quick solutions
Nice - got be back up and running in no time. Thanks man...
Awesome! I'm back in Drupal
Whew - I was going through all my files trying to find my darn password and couldn't for the life of me remember what it was. The MD5 function in mySQL worked like a charm (the forgot password request page didn't - for some reason the email never got sent out).
Thank you!!