1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Promote to admin via database

Discussion in 'XenForo Questions and Support' started by Dylan, Feb 17, 2011.

  1. Dylan

    Dylan Member

    Hi, is there a way to promote myself to admin running a sql query? Also, I was deleted from my board...could I restore my account somehow?
  2. Mike

    Mike XenForo Developer Staff Member

    It's not trivial to re-add yourself as an admin. It really needs to be done via the interface. It should not be possible to delete the last admin user, so another admin should be able to make you an admin.

    There's no way to restore your account if it's deleted.
  3. Dylan

    Dylan Member

    Sooo...I guess i'm just locked out? :S What should I do to get back in?
    EDIT: I have cPanel/FTP/Full server access if that's any help.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Is the other admin not able to set your new account as an administrator?

    You could always import a backup from before your account was deleted, but of course you will lost any content, members, etc. created since then.
  5. Dylan

    Dylan Member

    The other admin doesn't want me back in the site lol.
  6. Mike

    Mike XenForo Developer Staff Member

    You need to set your user ID up as a super admin in config.php (you should see an example in there, it's comma delimited).

    Your record in the xf_user table needs to have is_admin = 1.

    You need to have a record corresponding to your user id in the xf_admin table.

    (Note, untested :))
  7. Tilkißey

    Tilkißey Well-Known Member

    see below post

    and, adding 3 steps to this steps / for my idea
    edit 3 defines from xf_user template (in ur id's row)
    i dont remember all of them names clearly and i cannot access to phpmyadmin coz of my net connection settings

    admin usergroup id = 4 in default
    so, u ve to edit ur usergroup id to 4
    and, edit ur showing user group id to 4
    and, edit ur permission id to 4

    is it right Mike?
  8. Mike

    Mike XenForo Developer Staff Member

    In terms of getting into the admin CP, that doesn't matter. I was assuming the necessary configuration would be done after the admin was setup.
    Tilkißey likes this.
  9. Tilkißey

    Tilkißey Well-Known Member

    ok, thanks Mike, so, i edited my message
  10. jeffwidman

    jeffwidman Active Member

    FYI for anyone later googling this--this is all you need to do to get into the ACP. Once you're in, then go to Users > Admins and add your user as an admin. It will fill out the xf_admin table values correctly once you add yourself as an admin.

Share This Page