0

Hi There.

Is it possible to use the LOAD DATA LOCAL INFILE command from a crontab or what will the best way be of importing a csv on a hourly basis.

Regards

2
Contributors
2
Replies
5
Views
7 Years
Discussion Span
Last Post by LRNPHP
0
shell> mysqlimport [options] db_name textfile1 [textfile2 ...]

See http://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html and particularly, search for a comment about csv files on Windows (which you will want to alter to your specific platform)

Hi GrisWolf

Figured it out yesterday. Thanks for your help.

mysql -u**** -p**** database --execute="LOAD DATA LOCAL INFILE 'C:\\import.csv' INTO TABLE table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1, field2, field3)"

Regards

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.