I'm trying to import the csv file into MySQL. Here is the file itself:

idTelephone, Surname, Name

"+380500719216", "Sckoriy", "Sergey"

This is how I import:

LOAD DATA INFILE 'E:\Test.csv' INTO TABLE `testcvs` FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY 'n' IGNORE 1 ROWS; 

Here is the table:

enter image description here

Throws an exception:

 16:43:36 LOAD DATA INFILE 'E:\Test.csv' INTO TABLE `testcvs` FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY 'n' IGNORE 1 ROWS Error Code: 1261. Row 1 doesn't contain data for all columns 0.000 sec 
  • one
    LINES TERMINATED BY '\n' - Enikeyschik
  • Is there a blank line between the line with the headers and the data? - Enikeyschik
  • Enikeyschik, thanks !!! Works - Sckoriy

0