Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2007
    Location
    Leicestershire, UK
    Posts
    14
    Plugin Contributions
    0

    database error Problem Importing SQL database to new database ready for testing Zencart 1.5

    Just starting the process to upgrade from 1.3 to 1.5, but have fallen at first hurdle. I have exported my existing Zencart Database from PHPmyAdmin using the Zencart recommendations for settings, I then try to import my exported database to my new database ready to test Zencart 1.5 and make all the mods, but I keep getting the error message, shown below. I have listed the first table code. I am sure this is caused by the options I am using in export but I just cannot work out how to fix it.

    #1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key

    CREATE TABLE IF NOT EXISTS `pof_address_book` ( `address_book_id` int(11) NOT NULL auto_increment, `customers_id` int(11) NOT NULL default '0', `entry_gender` char(1) NOT NULL default '', `entry_company` varchar(32) default NULL, `entry_firstname` varchar(32) NOT NULL default '', `entry_lastname` varchar(32) NOT NULL default '', `entry_street_address` varchar(64) NOT NULL default '', `entry_suburb` varchar(32) default NULL, `entry_postcode` varchar(10) NOT NULL default '',
    `entry_city` varchar(32) NOT NULL default '', `entry_state` varchar(32) default NULL, `entry_country_id` int(11) NOT NULL default '0', `entry_zone_id` int(11) NOT NULL default '0') ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1357 ;


  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,486
    Plugin Contributions
    88

    Default Re: Problem Importing SQL database to new database ready for testing Zencart 1.5

    What version of phpMyAdmin are you using? What selections did you make when you exported the database?

  3. #3
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Problem Importing SQL database to new database ready for testing Zencart 1.5

    When doing the Export - configure the "Object creation options" as follows:

    Add statements:
    Add CREATE DATABASE / USE statement -tick
    Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT statement - tick
    Add CREATE PROCEDURE / FUNCTION / EVENT statement -untick
    CREATE TABLE options: -tick
    IF NOT EXISTS -tick
    AUTO_INCREMENT -untick



    Cheers
    RodG
    Last edited by RodG; 22 Aug 2015 at 02:51 AM.

  4. #4
    Join Date
    Mar 2007
    Location
    Leicestershire, UK
    Posts
    14
    Plugin Contributions
    0

    Default Re: Problem Importing SQL database to new database ready for testing Zencart 1.5

    I am on PHP 5.3.3 and I have tried you Object Creation Options, but still have the same error message. The settings I am using are:

    Output - inputting file name, no compression and leaving all other settings as default
    Format - sql
    Format Specific options - Structure and Data
    Object Creation options - have tried both checking all options and also RodG suggestions but getting same error
    Data Dump- INSERT and "both of the above" checked, and then all the defaults

  5. #5
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Problem Importing SQL database to new database ready for testing Zencart 1.5

    What version of phpMyAdmin are you using (the top of the SQL dump will usually indicate the version and other information unless disabled when exporting)?

    It looks like the export snippet you supplied is not including the definition for the primary key of the table (thus the error message when trying to import).

    There was a bug in certain obsolete versions of phpMyAdmin which resulted in broken exports such as your example snippet (auto_increment in the column definition of the table, but primary key not specified inside the table definition).
    Last edited by lhungil; 22 Aug 2015 at 08:41 AM.

  6. #6
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Problem Importing SQL database to new database ready for testing Zencart 1.5

    Quote Originally Posted by gillpotsoffun View Post
    Just starting the process to upgrade from 1.3 to 1.5, but have fallen at first hurdle. I have exported my existing Zencart Database from PHPmyAdmin using the Zencart recommendations for settings, I then try to import my exported database to my new database ready to test Zencart 1.5 and make all the mods, but I keep getting the error message, shown below. I have listed the first table code. I am sure this is caused by the options I am using in export but I just cannot work out how to fix it.
    As lhungil has cleverly observed, this could be (read: Probably is) related to a bug in an older version of phpmyadmin.

    All is not lost though - You could ask your hosting provider to update this software - OR, you can try this.

    1) Install ZenCart V1.5 on the new server - but DON'T install the demo/sample products.
    2) Using phpmyadmin on the new server select the database. (this should give you a list of all the tables).
    3) Click the 'empty' button on any tables that have more than '0' rows. (or select all tables, then select 'empty' from the dropdown box)

    4) On the old server do another 'export' using the same settings as you did previously, but this time make sure the option
    "Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT statement" is UNCHECKED.
    5) Try the import again.

    Sorry, but I can't *guarantee* that this will work because there could be differences in the table structure between the two difference versions of ZenCart.

    If it doesn't work, you could also try exporting/importing as a two step process.
    On the first export, select 'structure' (rather than structure and data). Ensure the
    "Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT statement" is CHECKED.
    Import this into the new server. If there are no errors, go back to the original server and perform another export of just the 'data'
    (rather than structure and data). Ensure the
    "Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT statement" is UNCHECKED.
    Import into the new server

    Again, I can't guarantee that this will work, but if it does fail it will do so when trying to do the 1st import (the 'structure').

    If *neither* method works, and your host won't update their phpmyadmin version, there are still other methods possible, but I feel it best to not go there at this point in time. Please do let us know though.

    Cheers
    RodG
    Last edited by RodG; 23 Aug 2015 at 03:07 AM.

  7. #7
    Join Date
    Mar 2007
    Location
    Leicestershire, UK
    Posts
    14
    Plugin Contributions
    0

    Default Re: Problem Importing SQL database to new database ready for testing Zencart 1.5

    I have passed this to my host and hopefully they will either have a solution or update the phpmyadmin. If not then I will try your suggestions. I will keep you posted.

  8. #8
    Join Date
    Mar 2007
    Location
    Leicestershire, UK
    Posts
    14
    Plugin Contributions
    0

    Default Re: Problem Importing SQL database to new database ready for testing Zencart 1.5

    My host did not suggest upgrading Myphpadmin, but said I should copy the database, which I have done and I have managed to get it to work! Thanks for your suggestions problem solved, for this purpose.

  9. #9
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Problem Importing SQL database to new database ready for testing Zencart 1.5

    Quote Originally Posted by gillpotsoffun View Post
    My host did not suggest upgrading Myphpadmin, but said I should copy the database, which I have done and I have managed to get it to work! Thanks for your suggestions problem solved, for this purpose.
    Thanks for letting us know that you've solved the problem, but I have to ask, How did you manage to copy the database? Most people don't have direct access to the database files to be able to do this.

    Cheers
    RodG

 

 

Similar Threads

  1. Error importing old database to the new database
    By wmorris in forum Upgrading to 1.5.x
    Replies: 1
    Last Post: 3 Jan 2012, 08:27 AM
  2. HELP importing sql database
    By mrtwelvevolts in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 6 Feb 2011, 06:38 PM
  3. HELP importing sql database
    By mrtwelvevolts in forum General Questions
    Replies: 1
    Last Post: 6 Feb 2011, 04:33 PM
  4. Replies: 4
    Last Post: 15 Oct 2010, 07:18 AM
  5. SQL Errors when importing to new database - #1062 - Duplicate entry '3' for key 1
    By countingsheep in forum Upgrading from 1.3.x to 1.3.9
    Replies: 3
    Last Post: 17 Sep 2009, 09:43 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR