Post by snappyfish » Thu Mar 19, 2015 10:02 pm

Hi,

I have done this many times before excatly the same as this http://isenselabs.com/posts/step-by-ste ... new-server

When importing the database into phpmyadmin locally (wamp server) I get this error below?

Code: Select all

SQL query:

CREATE TABLE IF NOT EXISTS `address` (
`address_id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`customer_id` int( 11 ) NOT NULL ,
`firstname` varchar( 32 ) COLLATE utf8_bin NOT NULL default '',
`lastname` varchar( 32 ) COLLATE utf8_bin NOT NULL default '',
`company` varchar( 32 ) COLLATE utf8_bin NOT NULL ,
`company_id` varchar( 32 ) COLLATE utf8_bin NOT NULL ,
`tax_id` varchar( 32 ) COLLATE utf8_bin NOT NULL ,
`company_no` varchar( 32 ) COLLATE utf8_bin NOT NULL ,
`company_tax` varchar( 32 ) COLLATE utf8_bin NOT NULL ,
`address_1` varchar( 128 ) COLLATE utf8_bin NOT NULL ,
`address_2` varchar( 128 ) COLLATE utf8_bin NOT NULL ,
`city` varchar( 128 ) COLLATE utf8_bin NOT NULL ,
`postcode` varchar( 10 ) COLLATE utf8_bin NOT NULL ,
`country_id` int( 11 ) NOT NULL default '0',
`zone_id` int( 11 ) NOT NULL default '0'
) ENGINE = MYISAM DEFAULT CHARSET = utf8 COLLATE = utf8_bin AUTO_INCREMENT =253;

MySQL said: Documentation
#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key 
Last edited by snappyfish on Tue Mar 24, 2015 12:25 am, edited 2 times in total.

Active Member

Posts

Joined
Thu Apr 14, 2011 4:36 am

Post by snappyfish » Mon Mar 23, 2015 8:43 pm

Anyone?

Active Member

Posts

Joined
Thu Apr 14, 2011 4:36 am

Post by soundzgood-nz » Tue Mar 24, 2015 5:28 pm

Needs a primary key on the address_id ... change the second line to:

`address_id` int( 11 ) NOT NULL AUTO_INCREMENT primary key,

Simon

User avatar
Active Member

Posts

Joined
Sat Oct 25, 2014 5:15 pm
Location - New Zealand

Post by snappyfish » Wed Mar 25, 2015 2:25 am

soundzgood-nz wrote:Needs a primary key on the address_id ... change the second line to:

`address_id` int( 11 ) NOT NULL AUTO_INCREMENT primary key,

Simon
Thanks, do you know why it has exported from the server like that? When I view the database in phpmyadmin which is live on the web server it shows the structure as you mention above.

Active Member

Posts

Joined
Thu Apr 14, 2011 4:36 am

Post by snappyfish » Wed Mar 25, 2015 5:43 pm

This is some of what it is adding at the bottom of the exported db from phpmyadmin from a live site on the server, All the Primary keys are added at the bottom like below and not as my first post.

Code: Select all

-- Indexes for table `address`
--
ALTER TABLE `address`
 ADD PRIMARY KEY  (`address_id`), ADD KEY `customer_id` (`customer_id`);

--
-- Indexes for table `affiliate`
--
ALTER TABLE `affiliate`
 ADD PRIMARY KEY  (`affiliate_id`);

--
-- Indexes for table `affiliate_transaction`
--
ALTER TABLE `affiliate_transaction`
 ADD PRIMARY KEY  (`affiliate_transaction_id`);

--
-- Indexes for table `attribute`
--
ALTER TABLE `attribute`
 ADD PRIMARY KEY  (`attribute_id`);

--
-- Indexes for table `attribute_description`
--
ALTER TABLE `attribute_description`
 ADD PRIMARY KEY  (`attribute_id`,`language_id`);

--
-- Indexes for table `attribute_group`
--
ALTER TABLE `attribute_group`
 ADD PRIMARY KEY  (`attribute_group_id`);

--
-- Indexes for table `attribute_group_description`
--
ALTER TABLE `attribute_group_description`
 ADD PRIMARY KEY  (`attribute_group_id`,`language_id`);

--
-- Indexes for table `banner`
--
ALTER TABLE `banner`
 ADD PRIMARY KEY  (`banner_id`);

--
-- Indexes for table `banner_image`
--
ALTER TABLE `banner_image`
 ADD PRIMARY KEY  (`banner_image_id`);

Active Member

Posts

Joined
Thu Apr 14, 2011 4:36 am

Post by snappyfish » Fri Mar 27, 2015 9:39 pm

Can anyone please help me understand what is wrong here? Is this a previous upgrade error?

My host says it's a mysql mismatch error?

Active Member

Posts

Joined
Thu Apr 14, 2011 4:36 am

Post by soundzgood-nz » Mon Mar 30, 2015 6:28 pm

You've exported the sql dump from a lamp server and importing into a wamp setup?
Are both origin and destination running the same version of mysql?

User avatar
Active Member

Posts

Joined
Sat Oct 25, 2014 5:15 pm
Location - New Zealand

Post by snappyfish » Mon Mar 30, 2015 11:29 pm

soundzgood-nz wrote:You've exported the sql dump from a lamp server and importing into a wamp setup?
Are both origin and destination running the same version of mysql?
After some emails back and forth to my hosting company, seems it might be a server error on phpmyadmin. Will find out soon if it is.

Primary keys are set when I view it live but when I export database it comes out wrong.

Active Member

Posts

Joined
Thu Apr 14, 2011 4:36 am
Who is online

Users browsing this forum: No registered users and 18 guests