Importing CSV Data into MySQL Without Header Row
You're facing challenges importing a CSV file into MySQL without header row and starting from the second field.
SOLUTION
To achieve this, utilize MySQL's ability to set column values during import. Since your id field is auto-incrementing, you can set it to null during import. MySQL will then assign appropriate values to it.
Implement the following code in the SQL tab of phpMyAdmin:
LOAD DATA INFILE 'path/to/file.csv' INTO TABLE your_table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' SET>
EXPLANATION
The above is the detailed content of How to Import CSV Data into MySQL Without Header Row and Starting from the Second Field?. For more information, please follow other related articles on the PHP Chinese website!