MySQL Forums
Forum List  »  MySQL Workbench

Loading a file into MYSQL table error code 1062 Duplicate entry for primary key
Posted by: Pete Watters
Date: February 13, 2018 01:59PM

The table is empty before load statement is executed
do a select * from code_protocol;
only entry is line with null values for all columns/fields

To test the error I created from excel by saving a comma delimited *.csv file

The csv file has only one entry/row and I am only loading primary key and one other column.

load data infile 'c:/wamp64/tmp/code_protocol1.csv'
into table code_protocol
FIELDS terminated by ','
enclosed by '"'
lines terminated by '\r\n'
ignore 1 rows
(protocol_id, protocol_disc
);

what am I doing wrong?

Options: ReplyQuote


Subject
Views
Written By
Posted
Loading a file into MYSQL table error code 1062 Duplicate entry for primary key
2236
February 13, 2018 01:59PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.