Home » Questions » Computers [ Ask a new question ]

How do I take control of a Drupal installation on my web space without the admin credentials?

How do I take control of a Drupal installation on my web space without the admin credentials?

Someone set up a website for me recently, using Drupal, and before I could get his admin credentials, I lost contact with him. Seeing as it's my web space, I do have access to the files and the database (which I have downloaded), however I can't get into the Drupal configuration.

Asked by: Guest | Views: 388
Total answers/comments: 2
bert [Entry]

"If you have access to the database directly (through phpMyAdmin or some other means), you will have to execute a query to change the super-administrator password.

First, you will need an MD5 hash of the password you want to use. Go to this website, and type the text you want to use for the password, click the button, and you will be gifted with the MD5 hash string.

Next, log into your database. You'll need to execute the following query against your Drupal database to reset the admin username and password:

Query syntax may change slightly if you aren't using MySQL:

UPDATE `users` SET `name`='your login name',
`pass`='your password in MD5 hash form' WHERE `uid`=1;

You should be able to log with the admin credentials you specified at this point."
bert [Entry]

"The easiest way to do this is to install drush and use the drush uli command. That will get you right in with a one-time link.

For example:

drush uli -l mydomain.com

You could also log in as a specific user with:

drush uli -l mydomain.com joe_user

Note that the -l option is not required if your site has a base_url set.

Drush is a command-line interface for Drupal that provides several very handy capabilities. See github.com/drush-ops/drush for information on obtaining and using drush."