Insert file data into DB table
by Vinoth[ Edit ] 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;