tags:

views:

37

answers:

1

i have a 3rd party software and i exported the database structure so that i can import it on another computer. i guess a few tables have multiple primary keys but how can i import the tables witout mysql stopping the import because it has detected multi primary keys?

this is the error i get:
1068 - Multiple primary key defined

i have defined this into the sql file.

SET FOREIGN_KEY_CHECKS=0;
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

and the import still stops on import when it detects multi primary keys.
is there anything else i can do??

thanks

+1  A: 

You can't have multiple primary keys. You can, however, have one primary key that is made up of multiple attributes. Make sure you are in fact trying to only create a single primary key. Disabling foreign keys will not make a difference here because the two things are not related.

I would check what create table or alter table statements you are using and make sure they are all creating a single primary key.

My guess is this software is taking a multi-attribute primary key and trying to create a primary key for each of the attributes.

northpole