I am using LOAD DATA INFILE to import multiple csv files into MySQL database, for this I use a bash script. Now I want to log all the errors to log file or STDOUT which occurs while loading the files into databse. I am able to get the warnings while loading into a STDOUT file, which eventually loads into log file.
I want to achieve the following things
1) I want to capture number of records loaded into databse 2) I want to capture the csv file name details, and error details
Below is the load data infile command used inside the bash script
load data local infile $APOSTROPE$DIR_STAGING$FILE_TR_HI_MASTER$FILE_EXTEN$APOSTROPE into table $TRANS_TABLE fields terminated by '$COLUMN_DELIM' lines terminated by '$UNIX_LINE_DELIM' (PROGRAMAMOUNT,@ENTRY_DATETIME,) SET ENTRY_DATETIME=STR_TO_DATE(@ENTRY_DATETIME,'$DATE_FORMATTER'); SHOW WARNINGS;
Please help me
Thanks