Thursday, July 10, 2014

Import and Export CSV file into mysql database

SELECT * from  `table name` INTO OUTFILE 'table.csv' FIELDS ENCLOSED BY '"' TERMINATED BY ';' ESCAPED BY '"' LINES TERMINATED BY '\r\n'

find / -type f -name table name.csv

load data  infile 'table.csv' into table table name fields terminated by ',' enclosed by '"' lines terminated by '\n'

No comments:

Post a Comment