Possible Duplicate:
Tool for importing CSV files into MySQL database?
A guy at work gave me a .csv file with thousands of records in it. There’s about 5 columns (out of 20) that I would love to get inserted into a mysql database.
Any idea how I might go about that?
Using
LOAD DATA INFILE. The example in the docs for CSV is:You should remove the
IGNORE 1 LINESclause if there is no header row in the CSV data.Also, note that the order of the data in the file should match the order of the columns in the table. If they do not, you will need to specify the order like this: