I'm attempting to load a .txt file into the existing invoice table. When trying LOAD DATA INFILE, MYSQL goes through all of the rows in my .txt file then throws this error message.
'Error Code: 1261. Row 541909 doesn't contain data for all columns'.
It's obviously going through every row of data then gets to the next row and reads it as part of the dataset. Is there a way to limit the rows read or an END statement I am missing? This file was a .csv but I found out the dataset was littered with random commas in strings.
LOAD DATA INFILE 'C:/ProgramData/MySQL/MySQL Server 8.0/Uploads/e_commerce_data.txt'
INTO TABLE invoice
CHARACTER SET latin1
fields terminated by ' '
lines terminated by '\r'
ignore 1 lines;