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

XF 1.5 Cleanly delete accounts via SQL

Discussion in 'XenForo Questions and Support' started by Andy.N, Jul 24, 2015.

  1. Andy.N

    Andy.N Well-Known Member

    I have a handful of users that created multiple accounts when their initial attempts caused some errors.
    When i tried to deleted those failed accounts, there was not any option in the ACP to remove those accounts.

    It will complain that those accounts have no valid email address, no valid password, usergroup, etc.

    I wonder if I can remove these account via mysql cleanly? If so, which query would be the one?
  2. Mouth

    Mouth Well-Known Member

    Merge them all into a single account?
  3. Andy.N

    Andy.N Well-Known Member

    I end up removing their accounts via sql by dropping the corresponding rows on xf_users table.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Are you sure you don't now have orphaned data?

    What was the original cause for the failed/corrupt accounts?
  5. Andy.N

    Andy.N Well-Known Member

    Was causing by one of the addons, can't remember which one. About a couple new registrations got affected. Once it was fixed, new registrations worked normally.
    The affected accounts I couldn't delete via normal options and I'm pretty sure they didn't get far (no posts, etc) so there is no data for them.
  6. Liam W

    Liam W Well-Known Member

    Yes, but user data is spread across multiple tables.

    Check out all tables starting xf_user_ plus any from add-ons.

  7. Daniel Hood

    Daniel Hood Well-Known Member

    Also you have to worry about tables that will have orphaned data such as the conversation tables, xf_thread_watch, etc. Doing it through mysql seems like a really bad approach.
  8. James

    James Well-Known Member

    Is there a way to delete accounts via the interface? I can't remember.

    It may be worth looking through the registration files to see what data is inserted into the database on registration then create a query to undo those entries.
  9. Brogan

    Brogan XenForo Moderator Staff Member

    Yes, accounts can be deleted via the ACP.

    However, it sounds like that was failing due to them being incomplete/corrupt due to an add-on.

Share This Page