You can change you LOAD DATA INFILE Statement to adjust values. Something in this direction should work.
LOAD DATA INFILE 'filepath.csv' INTO TABLE MyTable(Column1,@Col2,@Col3) SET Column2=CASE WHEN @Col2 = '' THEN 0 ELSE @Col2 END ,Column3=CASE WHEN @Col3 = '' THEN 0 ELSE @Col3 END;
This query imports the value as indicated in column1, and corrects the values ββfor columns 2 and 3. Using this, you do not need to turn off strict mode, and you actually control what data arrives in your database, they can fix it in a reliable way. You can also use this function to change date formats or import hex encoded blob values. Very useful feature.
source share