Sunday, June 3, 2012

Mysql import from CSV file from one machine to another

To import a csv file from one machine to a server, use the following command from the machine that hosts the csv file:



mysqlimport -h nameofserver --verbose --local --default-character-set=utf8 --columns="column1,column2"  --fields-terminated-by=","  -uyourusername -pyourpassword nameofdatabase nameofcsvfile.csv

No comments:

Post a Comment