Announcement

Collapse
No announcement yet.

Database Issues

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Database Issues

    Yesterday, I lost my user table in my database, due to a bad drive.

    I restored only the user table from a two day old backup, in an effort not to lose any posts.

    Of course, now I've having problems with new people registering. If I delete the last person who registered (UID: 6107), One person can register, taking that UID, but then the next person who registers gets a MySQL error.

    The error is on the "INSERT INTO USER" command, and the error is:

    mysql error: Duplicate entry '6107' for key 1

    mysql error number: 1062


    It seems like vB doesn't know to increment the UID. Is there a key in the DB that I can edit to fix this problem real quick? Seems there should be a simple solution to this..

    Thanks for any help

  • #2
    Were any users added since that backup? If so, then you need to restore the userfield and usertextfield tables too. Any new users will be lost though.

    Run this query to reset the auto-increment:

    Code:
    ALTER TABLE `user` CHANGE `userid` `userid` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' AUTO_INCREMENT;
    Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
    Change CKEditor Colors to Match Style (for 4.1.4 and above)

    Steve Machol Photography


    Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


    Comment


    • #3
      AHHHH.. Yes, userfield and usertextfield.. There was about 8 UID's that were orphaned from 6108-6116 or so... I deleted those from both tables, and I was able to register a new user.

      I also did that command you posted.. you know, just for the sake of being thorough..

      Thank you very much, sir.

      Comment

      Loading...
      Working...
      X