Archive

Archive for the ‘MySQL’ Category

MySQL – importing data

February 22nd, 2009 deevis No comments

I needed to bulk load data into a MySQL instance a bit ago and here’s the way to do it:

You should login to mysql and select the correct database/schema prior to running that command.

mysql -uusername -p

use <schema>;

load data local infile 'data.csv' into table <tableName>
fields terminated by ','
enclosed by '"'
lines terminated by '\n'
(<columnName1>,
<columnName2>, <columnName3>) ;

Categories: MySQL Tags: