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

XF 1.1 How to change one username by msql queries?

Discussion in 'XenForo Questions and Support' started by Barbossa, Dec 3, 2012.

  1. Barbossa

    Barbossa Active Member


    How can I change username let us say "Tom" into "Jerry"? I want to do this through mysql queries.

    Thanks in advance.
  2. Morgain

    Morgain Well-Known Member

    Why not just change the user account name in admin?
    Jake Bunce likes this.
  3. Barbossa

    Barbossa Active Member

    Morgan, I am having some utf8 issues for some characters. I will dig it later. Right now I want it mysql way. Do you know it?
  4. karll

    karll Well-Known Member

    It would be something like this:

    update xf_user set username = 'Jerry' where username = 'Tom';
    Disclaimer: I've never changed a username this way before, but I believe the above SQL should be correct. If for some reason it doesn't work properly, you can always just change it back with a similar query.
    Jake Bunce and Barbossa like this.
  5. James

    James Well-Known Member

    It'd be easier via the ACP, I'm not sure if there are other tables that need updating with the username.
    Jake Bunce likes this.
  6. karll

    karll Well-Known Member

    Yes, that would be my worry as well, but if Barbossa desperately wants to try the SQL route, then he can try the above query.

Share This Page