New answers tagged import
Errors occured because of unescaped backshlashes. Values preceeded with \ were inrepereted as ascii signs, but they weren't. To avoid this error backslash - \ should be escaped by additional backslash - \ so occurences of backslashes should be changed to double backslashes - \\ .
Well I see you are working on windows environment. There is a way that I use to do such imports from csv and I hope it helps you too. I am using a GUI tool called SQLyog. It is perfect for managing databases on mySQL and specially runs on Windows. So you can try it, it has options to import external data from csv directly and the empty columns are returned ...
Something like this, checking every value for '', and inserting NULL instead, may help. Change a,b,c,d for the actual name and number of rows on the table: $ cat /tmp/test.csv test1, test2, test3, test4 ,,, 1,2,3,4 ,,, mysql> LOAD DATA INFILE "/tmp/test.csv" INTO TABLE test.test FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY ...
Top 50 recent answers are included