Hello all,

After few "bad manipulations", i lost my user #1 (deleted somehow) with obviously all admin powers. I'm still able to view and navigate throughout the site but unable to access any admin navigation panel.
Is there a way to either retreive my lost #1 user access, or give full power to a new one using phpmyadmin or?... without having to reinstall drupal from scratch?
Any help will be greatly appreciated

Gladiator

Comments

wulff’s picture

I haven't tested this, but a variation of this approach should work.

In phpmyadmin: Check the 'users' table to make sure that there is no user with uid=1. If there isn't, add a new row and set 'uid' to 1, 'name' to your desired username and 'pass' to the md5 hash of your desired password (you use http://md5-hash-online.waraxe.us/ to calculate the hash).

pamphile’s picture

in phpmyadmin when inserting or updating, you can also MD5 the data and automatically regenerate the correct password

http://01businesses.com

Gladiator@code0range.net’s picture

Thanks so much guys!!! It worked.

8tropos’s picture

Hi wulf,

Can you be please more precise into how you create UID 1 again in the db after losing it for whatever reason.

I'm experiencing a similar problem an notices the UID 1 does no longer exist within my db.

Thx.

pamphile’s picture

my advice... WARNING - I never tried this before:

Backup your drupal

Install another Drupal... a export all SQL statements for user # 1 within these tables.
'users'
'sessions'
'role'
'authmap'
'sequences'

Then import them to your damaged database.

Marcel
http://scriptmigration.com
http://cardiary.com