Insert file data into DB table

by Vinoth 2009-02-09 09:29:42

We can load a list of file data into table by using bellow query

mysql>load data local infile "filename.txt" into table table_name;//location of "D://Program Files/MySQLMySQL Server 5.0/bin/filename.txt"

Example:
Consider a text document

name1 address1
name2 address2
name3 address3
name4 address4
name5 address5
name6 address6

Now we have to add the data in text file to table.
mysql>create table data(name varchar(20),address varchar(100));
mysql>load data local infile "filename.txt" into table data;

Tagged in:

764
like
0
dislike
0
mail
flag

You must LOGIN to add comments