I have a Drupal site I need to log in to to install modules and whatnot, but I've never had an account with it to begin with and all the passwords for the existing accounts have been lost. I do have FTP and mySQL access, so I need to know how to go through the database and manually add an account with the right permissions. I also don't even know what the url is to log in to the admin control panel in the first place.

I don't know which version the site is running or how to check. I did find "$Id: index.php,v 1.90 2006/01/27 18:51:51 dries Exp $" at the top of the index.php file, I don't know if this is useful or not.

Can anyone give me some help with this?

Comments

alihammad’s picture

If I were you I would use drupal api's user_save () function , look here http://api.drupal.org/api/function/user_save for info. You could simply use it by opening a node, choosing php filter, loading old user database (or filling values the way you want) and feeding values into user_save(). Simple :)

Ali Hammad Raza
WordsValley

AmandaIP’s picture

Sorry, I have absolutely no idea what you mean. I've never used Drupal before.

choster’s picture

If you have access to the database, say through phpMyAdmin, look in the "users" table. User 1 is the root login. You can change the e-mail address for that user to an account you have access to, then recover the password as usual to gain access to the site administration pages.

AmandaIP’s picture

Ah, that worked...thanks. I just hope whoever's account I just hijacked doesn't want to use it again anytime soon....