Here is my journal, I'm just to use this as journal of my work, to keep remember what i found in doing my day to day work. So i'm not really mean to make a nice blog, but hope this may help some people too.

Friday, October 10, 2008

Importing CSV to mysql

I'm just trying to import csv file to mysql table database. 
Here is the command:

load data local infile 'csv file
into table target table 
fields terminated by ','
ignore 1 lines;

The basic command to import data is "load data"
To read your file you can use the "local infile 'your.csv'"
Then you need to specify what delimeter of each file in your file by "fields terminated by ','"
To ignore header field, use "ignore 1 lines"

No comments: