Announcement

Collapse
No announcement yet.

Duplicate entry '172667' for key 1

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

  • stuuu
    replied
    Originally posted by jason|xoxide View Post
    It sounds like you may have a broken auto-increment value. As to your second post, is that the query you ran? If so, it's not going to work unless you dropped the existing index first, but I doubt that that is even the index with the issue since it's on a completely different table...

    You could try an actual "REPAIR TABLE" to see if that helps. If not, you may have to run the queries below to reset the auto-increment on the `postid` field.

    First, run the following:
    Code:
    SELECT MAX(`postid`)+1 FROM `post`
    Next, run the following, substituting the result from the query above for 'xxx':
    Code:
    ALTER TABLE `post` AUTO_INCREMENT = xxx
    Thanks for your reply jason, I'll give these a go

    Leave a comment:


  • jasonlitka
    replied
    It sounds like you may have a broken auto-increment value. As to your second post, is that the query you ran? If so, it's not going to work unless you dropped the existing index first, but I doubt that that is even the index with the issue since it's on a completely different table...

    You could try an actual "REPAIR TABLE" to see if that helps. If not, you may have to run the queries below to reset the auto-increment on the `postid` field.

    First, run the following:
    Code:
    SELECT MAX(`postid`)+1 FROM `post`
    Next, run the following, substituting the result from the query above for 'xxx':
    Code:
    ALTER TABLE `post` AUTO_INCREMENT = xxx

    Leave a comment:


  • stuuu
    replied
    Originally posted by Paul M View Post
    What exactly are you asking ?
    I thought it was obvious, but I'll re-quote just for you.

    Can anyone give me any clue on what I can do to prevent this from happening in future?
    Also as my second post states, the index fix couldn't even complete without an error.

    Thank you in advance.

    Leave a comment:


  • Paul M
    replied
    What exactly are you asking ?

    Leave a comment:


  • stuuu
    replied
    Anyone? :/

    Leave a comment:


  • stuuu
    replied
    If it helps, I've just tried fixing the indexes and got this message.

    Code:
    Database error in vBulletin 3.6.5:
    
    Invalid SQL:
    ALTER TABLE postindex ADD UNIQUE KEY wordid (wordid, postid);
    
    MySQL Error  : Duplicate key name 'wordid'
    Error Number : 1061
    Date         : Tuesday, July 17th 2007 @ 12:38:54 PM
    Script       : http://dnbforum.com/admincp/repair.php?do=fixunique
    Referrer     : http://dnbforum.com/admincp/repair.php?do=fixunique
    IP Address   : 85.189.193.130
    Username     : sdm
    Classname    : vB_Database

    Leave a comment:


  • stuuu
    started a topic Duplicate entry '172667' for key 1

    Duplicate entry '172667' for key 1

    Hi there, I moved our vB install to a new server about 3 weeks ago with no problems at all. The new server is running PHP5 and MySQL5, today some problems started, and this seems to be the problem:
    Code:
    Database error in vBulletin 3.6.5:
    
    Invalid SQL:
    INSERT INTO post
        (showsignature, allowsmilie, username, userid, title, pagetext, iconid, visible, dateline, ipaddress, attach, threadid)
    VALUES
        (1, 1, 'sdm', 2, 'Testing', 'Testing', 0, 1, 1184670967, '85.189.193.130', 0, 34524);
    
    MySQL Error  : Duplicate entry '172667' for key 1
    Error Number : 1062
    Date         : Tuesday, July 17th 2007 @ 12:16:08 PM
    Script       : http://dnbforum.com/newthread.php?do=postthread&f=4
    Referrer     : http://dnbforum.com/newthread.php?do=newthread&f=4
    IP Address   : 85.189.193.130
    Username     : sdm
    Classname    : vB_Database
    I've just repaired the offending table and we're back up and running again. Can anyone give me any clue on what I can do to prevent this from happening in future?

Related Topics

Collapse

Working...
X