Thursday, July 24, 2014

Import a Large CSV file to MySQL commend line

Using the mysqlimport utility run below command.


mysqlimport  --ignore-lines=1 --fields-terminated-by=,--columns='ID,
columnName1,columnname2, columnname3' --local -u root -p 
Databasename /pathtocsvfile/tablename.csv


You must put the absolute path of the csv file for it to register with 
the utility. The “tablename.csv” has to match the name of the table in 
your mysql database.

For more information on the mysqlimport utility: Click Here

No comments:

Post a Comment