Skip to content

TERMINATED

LOAD DATA INFILE '/tmp/data.csv'
INTO TABLE tbl1
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n';

The command above won’t display any output on the terminal, it will just load the data from a file into your tbl1 table.

In SQL, the TERMINATED BY clause within the LOAD DATA INFILE command is used for identifying how the data set is split into multiple fields and lines. This example reads in a CSV file from the specified path and inserts the data into the table tbl1. Here, FIELDS TERMINATED BY ',' specifies that fields in each row are separated by a comma, and LINES TERMINATED BY '\n' specifies that a newline character indicates a new row.