Inserting into mysql table from a file with column names

by raja 2009-11-11 20:01:39

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
(column1, column2)

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.

Tagged in:

1140
like
0
dislike
0
mail
flag

You must LOGIN to add comments