Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2008
    Location
    Bristol UK
    Posts
    162
    Plugin Contributions
    0

    Default upgrading from 139h tp 1.5.1 error #1062 - Duplicate entry '1' for key 'PRIMARY'

    Hi

    I get the above error message along with:

    SQL query:

    --
    -- Dumping data for table `address_format`
    --
    INSERT INTO `address_format` ( `address_format_id` , `address_format` , `address_summary` )
    VALUES ( 1, '$firstname $lastname$cr$streets$cr$city, $postcode$cr$statecomma$country', '$city / $country' ) , ( 2, '$firstname $lastname$cr$streets$cr$city, $state $postcode$cr$country', '$city, $state / $country' ) , ( 3, '$firstname $lastname$cr$streets$cr$city$cr$postcode - $statecomma$country', '$state / $country' ) , ( 4, '$firstname $lastname$cr$streets$cr$city ($postcode)$cr$country', '$postcode / $country' ) , ( 5, '$firstname $lastname$cr$streets$cr$postcode $city$cr$country', '$city / $country' ) , ( 6, '$firstname $lastname$cr$streets$cr$city$cr$state$cr$postcode$cr$country', '$postcode / $country' ) ;



    MySQL said:

    #1062 - Duplicate entry '1' for key 'PRIMARY'


    I have installed a fresh copy of version 1.5.1. in a subdirectory
    Run the installer
    Exported the sql database file from the 1.39h version
    Imported this file into my new 1.5.1 database
    which gives the above errot message

    Please can anyone help?SQL query:

    --
    -- Dumping data for table `address_format`
    --
    INSERT INTO `address_format` ( `address_format_id` , `address_format` , `address_summary` )
    VALUES ( 1, '$firstname $lastname$cr$streets$cr$city, $postcode$cr$statecomma$country', '$city / $country' ) , ( 2, '$firstname $lastname$cr$streets$cr$city, $state $postcode$cr$country', '$city, $state / $country' ) , ( 3, '$firstname $lastname$cr$streets$cr$city$cr$postcode - $statecomma$country', '$state / $country' ) , ( 4, '$firstname $lastname$cr$streets$cr$city ($postcode)$cr$country', '$postcode / $country' ) , ( 5, '$firstname $lastname$cr$streets$cr$postcode $city$cr$country', '$city / $country' ) , ( 6, '$firstname $lastname$cr$streets$cr$city$cr$state$cr$postcode$cr$country', '$postcode / $country' ) ;



    MySQL said:

    #1062 - Duplicate entry '1' for key 'PRIMARY'


    Derek:(

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: upgrading from 139h tp 1.5.1 error #1062 - Duplicate entry '1' for key 'PRIMARY'

    Did you try dropping all the tables before importing your 1.3.9 DB?

    Or make a backup using this tutorial

    http://www.zen-cart.com/content.php?...atabase-backup

  3. #3
    Join Date
    Jul 2008
    Location
    Bristol UK
    Posts
    162
    Plugin Contributions
    0

    Default Re: upgrading from 139h tp 1.5.1 error #1062 - Duplicate entry '1' for key 'PRIMARY'

    Many thanks Kobra - that's cracked it!

    I did waste quite a bit of time searching past similar threads
    the "Welcome to Zen Cart" installation guide doesn't seem to cover this area unless it has recently been updated

    Derek

  4. #4
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: upgrading from 139h tp 1.5.1 error #1062 - Duplicate entry '1' for key 'PRIMARY'

    It's covered in the FAQ on making database backups: http://www.zen-cart.com/content.php?...atabase-backup
    -- note the options to check, which includes "include DROP TABLE ..."
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Replies: 3
    Last Post: 21 Jan 2016, 10:35 PM
  2. Replies: 2
    Last Post: 11 Dec 2012, 03:58 AM
  3. v151 PHP Fatal error:1062:Duplicate entry '1-1' for key 'PRIMARY'
    By Dopefish in forum General Questions
    Replies: 14
    Last Post: 19 Oct 2012, 02:58 AM
  4. Error when importing DB - #1062 - Duplicate entry '1' for key 'PRIMARY'
    By CheapStairParts in forum General Questions
    Replies: 0
    Last Post: 5 Jan 2011, 03:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg