This script
DROP TABLE IF EXISTS cmx_siusd_m1;
CREATE TABLE cmx_siusd_m1(trade_date DATETIME, si_open DECIMAL(8,5), si_high DECIMAL(8,5), si_low DECIMAL(8,5), si_close DECIMAL(8,5), si_ticks INT,
si_oi INT, PRIMARY KEY(trade_date));
LOAD DATA INFILE 'D:/datafolder/cmx_siusd_m1.csv' IGNORE INTO TABLE cmx_siusd_m1 FIELDS TERMINATED BY ','
IGNORE 1 LINES (@trade_date, si_open, si_high, si_low, si_close, si_ticks, si_oi)
SET trade_date = STR_TO_DATE(@trade_date, '%Y.%m.%d %H:%i');
can’t read this data
2009.04.17 13:45,11.95000,11.97000,11.94000,11.96000,41,0
2009.04.17 13:46,11.95000,11.97000,11.94000,11.95000,34,0
2009.04.17 13:47,11.96000,11.97000,11.94000,11.96000,32,0
2009.04.17 13:48,11.95000,11.97000,11.93000,11.96000,39,0
2009.04.17 13:49,11.97000,11.98000,11.94000,11.97000,42,0
2009.04.17 13:50,11.95000,11.98000,11.95000,11.97000,32,0
2009.04.17 13:51,11.96000,11.98000,11.96000,11.96000,34,0
I get the errors incorrect decimal value, incorrect integer value, and incorrect datetime value for each of the column tables in mysql.
After discussion in comments – your problem is format of your text file. After trying
\r\nand\nline termination we tried to create new file, with windows format and it worked.So problem is weird file format, with unknown line termination. If you need to use that file format (it comes from something and you dont want to re-write new file each import) – you can open that file in hexeditor and see what character codes are at the end of line.
Maybe this is
\n\r(not\r\n).