Deleted first user account?

Last modified: July 12, 2009 - 10:43

If, by accident, you happen to delete the original "Administrator" account/user, you will need to recreate it.

INSERT INTO users (uid, name, pass) VALUES ('1', 'yourname', md5('yourpassword'));

you can also try and work with the methods below:

UID1 is the 'super admin' account.

- create a new account with user name and password of your choice : this account will initially be a regular user account, to be turned into an "Administrator" account following the next step.
- go to database table "users" and change the UID of this new account to "1" - You may now login to this account as the super admin account.

if you use phpmyadmin for MySql database administration, this should only take a few seconds to fix.

user_register not enabled

The above only works if the "user_register" variable is *not* set to s:1:"0";.

UPDATE variable SET value = 's:1:"1";' WHERE name = 'user_register';
DELETE FROM cache WHERE cid = 'variables';

This will change your site so that you can follow the above instructions.

Prevent account cancellation for uid 1

For Drupal 5 and 6, you may want to check out the Protect Critical Users module.

For Drupal 7, this issue will be probably solved by then. See: #46149: Prevent account cancellation for uid 1

 
 

Drupal is a registered trademark of Dries Buytaert.