Inserting into mysql table from a file with column names
The following command can be used to import data from a file into a mysql database table.
LOAD DATA INFILE 'file.txt'
INTO TABLE t1
here the content of file file.txt will be imported into table t1 on fields column1 and column2.
We can also specify the terminating characters.