LINES
Example
Section titled “Example”CREATE TABLE example_table( id INT AUTO_INCREMENT, text VARCHAR(100), PRIMARY KEY(id));
LOAD DATA LOCAL INFILE 'file.txt' INTO TABLE example_tableLINES TERMINATED BY '\n'(text);Output
Section titled “Output”Query OK, 3 rows affected (0.03 sec)Explanation
Section titled “Explanation”This code creates a new table example_table with two columns id and text. Then it loads data from a local file 'file.txt'. Each line in the input file is considered as a new record. Therefore the LINES TERMINATED BY '\n' clause is used to indicate end of a record.