Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By interweb on
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
replace it
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
Thank you
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 !
database
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
=-=
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.
Solved !
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 !