if by any accident you happen to delete the original "Administrator" account/user (oh, my!) Drupal will not allow you to create a new "Administrator" user - it will only allow you to create a new anonymous user account, giving it a UID number in the "users" table of your database which is the UID number of the last-created account plus 1 - meaning that if the last-created account had been given ex. UID "151", your new UID will be 151+1= "152"
but this will not do - Drupal recognises as "Administrator" only the user account with UID of "1".
so what to do?
- create a new account with user name and pass of your choice : this account will initially be an anonymous 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" - and presto! you may login to this account as an "Administrator".
if you use phpmyadmin for MySql database administration, this should only take a few seconds to fix.
hope this helps,
abramo
Comments
Good tip
Maybe not a frequent problem, and is pretty obvious to the database-savvy, but I like your write-up, and think you should post it as a book page under troubleshooting.
Just 'create content' and make it. It'll get reviewed and published ... eventually.
here's one I prepared earlier which solves a (sorta) similar (id-related) problem.
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
@dman : many thanks : fine
@dman : many thanks : fine suggestion : shall do.
How does one restore the
How does one restore the nodes, such as pages, that were authored by the admin?
?
Not sure how this would be a problem.
If the nodes were owned by user ID #1 and user ID #1 is restored, the nodes should be fine.
... In the long run, this is why large userbase sites (and any user management system really) usually 'disable' rather than delete users. Often other legacy info assumes a valid user created it, and pulling that rug away can cause breakage in unpredictable places.
For your problem - are the nodes still listed in 'content' admin pages? If not, they may be truly gone - which isn't done by just removing a user. Not sure how you'd manage that by accident.
.dan.
if you are asking a question you think should be documented, please provide a link to the handbook where you think the answer should be found.
| http://www.coders.co.nz/ |
.dan. is the New Zealand Drupal Developer working on Government Web Standards
I need help!
The username intDex has not been activated or is blocked.
Damn, i was deleting all the bloody hell russian spam accounts when i clicked "delete all"
then I realised I need to "ok" their registration.
Now I've followed the above and changed the UserID, but I got that message above........ can someone help?
Ok problem fixed, in case
Ok problem fixed, in case anyone was looking for help and found this page this was what i did
I tried to type the password in cpanel, but it didnt work because I believe the system "hashes" it.
So I went into Cpanel, changed the "Status" value to 1 - This is for activation.
Then I click Forgot Password.
Bingo.
Oh abramo, thanks so much.
Oh abramo, thanks so much. Finally, I can restore my admin account with your help here :)
Hello, In my drupal website
Hello,
In my drupal website is forbit to create new accounts.
What i suppose to do? Is any chance to create new account in database?