Insert file data into DB table - Mysql Views : 764
Tagged in : Mysql
Send mail vote down 0 vote down 0
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;
By - Vinoth, On - 2009-02-09




    Login to add Comments .