Hi,

I deleted all users including user 1 by mistake. Now, I can't access the administrator page when I login. What can I do to solve this ?

Thank you

Comments

sepeck’s picture

See the Troubleshooting-FAQ Handbooks

Deleted first user account?

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

interweb’s picture

But to do that (change the newly created user to user no 1), I need to log in. And I can't log in without a username and password... I'm new with Drupal, so maybe I'm missing something here...

Thanks again !

sepeck’s picture

As an alternative, how recent is your backup and is it tested? If you do not have any other users, you can setup a test Drupal site and copy the user from that one and insert it into your database.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

VM’s picture

use your db tool

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

(Use your table name prefix (if any) and your username, password and email.)
When you log in go to user/1 and fill-in any other missing details.

interweb’s picture

1- I had no backup and now I have one (and I wasn't working with a test site).
2- Working directly with the database is new to me but is the way to go.

Thanks again !