I have Drupal 6 site. In deleting spammers I accidently knocked myself out. Can I reclaim admin on my own site? Help.

  • Did you block or did you delete the admin account?
    – Triskelion
    May 19, 2013 at 18:18
  • I accidently deleted myself. May 19, 2013 at 18:57
  • Then the only way is that suggested by Prem Ababd. For more information, check out the post by Wolfflow on drupal.org.
    – Triskelion
    May 19, 2013 at 19:08

2 Answers 2


If u are able to create account,create it and in the database for the 'users' table update '1' to the 'uid' field for the account you created and if you are unable to create a account then create a account manually in the database

INSERT INTO users (uid, name, pass) VALUES ('1', 'yourname',> md5('yourpassword'));
  • relatively new to drupal i appreciate your suggestion May 19, 2013 at 18:59
  • But is there other ways too? May 19, 2013 at 18:59
  • u dont kno how to follow the answer??
    – Prem Anand
    May 19, 2013 at 19:05
  • Not really I m a newbie May 19, 2013 at 19:59
  • Do u kno to create a account? or else post the url of your site.
    – Prem Anand
    May 19, 2013 at 20:30

Default method should be to backup entire page before mass operations, and then restore it in case of failure. If you cannot do it on your own, your hosting company probably have nightly backups they can restore for you if you ask them.

If that's not the case, but you can access SQL console or SQL web admin tool, see this answer.

If you can't access SQL console directly, but have file access, you can put SQL code in settings.php wrapped in db_query(), but be extremely careful, as it gets executed on almost every page hit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.