I’m trying to import a CSV file into a MySQL 5.1 DB using phpMyAdmin. The file includes several date columns which may contain NULL values. According to the manual, NULL should be written as \N. However, after an otherwise successful import, \N appears as 0000-00-00 in the date columns (as opposed to NULL). How do I get NULLs imported?
Options set:
- line separator
, - fields enclosed by
", - fields escaped by
\, - lines terminated by
auto.
phpMyAdmin distinguishes two CSV import formats:
CSVandCSV with LOAD DATA. The latter option actually accepts\Nas described in the manual.If columns are enclosed by a character (as it is the case), NULLs may also be imported using the former method (no
LOAD DATA) by setting a value to a non-enclosedNULLin the CSV file. This is in accordance with the manual‘s following statement: