How to insert selected columns from CSV file into MySQL database using LOAD DATA INFILE
P粉549412038
2023-08-29 13:56:45
<p>I have a CSV file with 10 columns. I just want to select some columns from this file and load them into a MySQL database using the <code>LOAD DATA INFILE</code> command. </p>
Load data into a table in MySQL and specify columns:
@col1,2,3,4 are variables that save csv file columns (assuming 4) name,id are table columns.