Import a CSV file into a table
suggest changeThe following command imports CSV files into a MySQL table with the same columns while respecting CSV quoting and escaping rules.
load data infile '/tmp/file.csv'
into table my_table
fields terminated by ','
optionally enclosed by '"'
escaped by '"'
lines terminated by '\n'
ignore 1 lines; -- skip the header row
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents