Receiving bogus duplicate ID message on table copy attempt in PhpAdmin

Discussion in 'MySQL' started by Darden12, Dec 1, 2011.

  1. #1
    I have a table in a mysql database that shows no apparent problems and has been optimized and repaired without problem. When I seek to copy it within the same database, I can do so without problem using the Operations option in PHPMyAdmin.

    However, when I export the file in phpAdmin and then attempt to import it into another database in phpAdmin, I receive a "duplicate ID" error message.

    I figure I'm using a correct method to copy tables between databases for the simple reason that the same process works fine with all my other tables.

    Can anyone tell me why such a table would export without problem and show no problems -- yet suddenly be flagged for duplicate IDs when I attempt to copy it to another database?

    The ID field is auto-increment and I've never manually changed an ID to my knowledge.

    Thanks for any ideas.

    Brian
     
    Darden12, Dec 1, 2011 IP
  2. adimsh

    adimsh Member

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    48
    #2
    do you have any INSERT INTO ... (autoincrement_field_name, ...) VALUES (0, ...) statements in the export?

    more info about your table schema and fields type, the error message you received will help diagnose the problem more deeply.
     
    adimsh, Dec 4, 2011 IP
  3. Darden12

    Darden12 Well-Known Member

    Messages:
    107
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #3
    Thanks for the response. Below is the beginning of the SQL that I'm attempting to import, followed by the error message I receive from phpMyAdmin when I attempt to copy the table.
    Error message...
     
    Darden12, Dec 4, 2011 IP
  4. Darden12

    Darden12 Well-Known Member

    Messages:
    107
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #4
    Problem solved. Here's what worked, for those who have similar trouble: When I exported, I deselected Auto-Insert in the export interface. After that, it worked fine.
     
    Darden12, Dec 6, 2011 IP