I am scanning 5000 csv files into a database. Regrettably the files have ”, for 0. Thus when ever I run my script it crashes. I heard that this error is possible to avoid by simply disabling strict mode. So I attempted to disable strict mode to allow me to read in an empty string as a 0 for my numeric fields. However the error persisted.
So does disabling strict mode allow ” to be read into a int field? (the ” is two qoutes i.e. empty string)
If so why did setting
sql_mode=''
in the my.ini config file does not fix the problem.
I guess you import the CSV file using
LOAD DATA INFILEcommand. Before you execute this command, type:More information about various SQL modes can be found in the documentation.