mysql - mysqlimport - Import CSV File in MS Windows XAMPP emvironment -


i trying import csv file mysql database command line. later incorporated windows batch file.

mysqlimport -u user -puserpw --columns=id,cid,alerted --fields-terminated-by=',' --local school customer.csv   

all data loads first column in customer table. want correctly import data csv appropriate column.

csv data format:

id,cid,alerted 1,cs,n 2,cs,n 3,cs,n 

i use mysqlimport since easier add windows batch file. how can please help?

i guess have add --lines-terminated-by='\n' mysqlimport. run quick test here , worked.

mysqlimport --local --ignore-lines=1 --fields-terminated-by=',' --lines-terminated-by='\n' db_name table_name.csv 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -