Import Large Size CSV / TXT File Into MySQL Database

by Dinesh 2014-06-21 14:11:21

Use this simple mysql command to load your large size CSV or TXT file to your database table. "LOAD DATA INFILE" command reads rows from a text file and intert into a database table.
 
LOAD DATA LOCAL INFILE 'Your_File_Name.csv' INTO TABLE table_name
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY ' '
IGNORE 1 LINES
(table_record1, table_record2, table_record3, table_record4)
SET CREATED = CURRENT_TIMESTAMP;

Where,
table_name -> Name of the database table name;
table_record -> shows the record name to be update by the given file.

Tagged in:

794
like
0
dislike
0
mail
flag

You must LOGIN to add comments