I want to upload a CSV file into an existing table in a MySQL DB.
I gather that the way this is done is with LOAD DATA INFILE.
If my understanding it correct, the file itself must be data only - no headers, OR you must instruct MySQL to ignore the first line.
What I would like to know is, is there a way to import the data WITH headers and have MySQL use the headers to channel the data into the right buckets? If possible I don't want to use headerless data because it introduces a risk of compromised data integrity if a file with fields in the wrong order is uploaded.