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

Is there away of changing admin password through mysql?

Discussion in 'XenForo Questions and Support' started by togermano, Sep 29, 2011.

  1. togermano

    togermano Member

    I forgot my admin password and unfort my email server isnt up yet and I cant get my password.. Is there away to change the admin pass hash to a well known one that way i can log in and change the pass
  2. Floris

    Floris Guest

    Try to make a new admin.
    set it up as super-admin
    and remove the original admin as super-admin.

    Then login to the acp, and change the pass on the first admin you forgot pass for.

    Login as that one. reset it as super admin, and undo the other super-admin, and delete the temporary created super admin ?
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    The password information is serialized in the database so you can't update it with simple SQL.

    In my testing I found that this works:

    1) Register a new account. You need a working username and password.

    2) Run this query on your database to flag that user as an admin:

    UPDATE xf_user
    SET is_admin = 1
    WHERE user_id = 3;
    3) Edit the library/config.php file and specify that user as a super admin:

    $config['superAdmins'] = '3';
    Separate by commas if there are multiple super admins:

    $config['superAdmins'] = '1,2,3';
    4) Now you can login to the Admin CP with full access. If you want the new admin to be permanent then you should setup proper admin permissions:

    Admin CP -> Users -> Administrators -> Create New Administrator

    Or you can edit the password for the old admin to regain access to that account:

    Admin CP -> Users -> Search for Users -> [find the account, edit the password]
  4. Floris

    Floris Guest

    jake just had to fancy up my post didn't he.
  5. Sezgin

    Sezgin New Member

  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

Share This Page