mysql - Duplicate Primary Key with Composite Key on inserting data -


i have table created , primary key composite key of first 2 columns (hostid, ipaddress). when try use load data infile fill table csv, tells me there duplicate primary key error. can guarantee each composite key unique. happening here? taking first column pk or problem insert of data? i'm working in mysql within msql. error message: "duplicate entry '0-' key 'primary'"

this load data infile code works everytime use now.

load data infile 'c:/users/admmathew.gake/documents/vim_hosts.csv' table vim_hosts fields terminated ',' enclosed '"' lines terminated '\n' ignore 1 rows 

this create query

create table vim_hosts (     hostid int(5) not null,     ipaddresses varchar(50) not null,     nodeid int(5) null,     datacenterid int(5) null,     manageobjectid varchar(20) null,     hostname varchar(30) null,     hoststatus int(5) null,     model varchar(30) null,     vendor varchar(20) null,     overallstatus varchar(10) null,     networkutilization float(20,15) null,     networktransmitrate float(20,10) null,     networkrecieverate float(20,10) null,     cpuload float(20,10) null,     cpuusagemhz int(10) null,     memusage float(20,10) null,     memusagemb int(15) null,     vmcount int(5) null,     vmrunningcount int(5) null,     primary key (hostid, ipaddresses) ); 


Comments