Take the 2-minute tour ×  I am selecting data from a database on
server A, dumping the output into a file locally, and then doing
a LOAD DATA INFILE on my local database. The bash command looks
something like this:  mysql -e "SELECT * FROM items WHERE
created_at > '2011-05-01';" > items  I was told this was the
correct way when moving data from an external server to a local
database. I think I would have normally chosen to use mysqldump,
but I didn't want to fuss with curling the dumped file from the
server to my local machine.  The data that is dumped to the
items file with the command line code above contains a lot of
NULLs. Those NULLs, when read by the LOAD DATA INFILE command,
run locally, ends up loading a bunch of strings of "NULL" into
my table. I want those to be properly translated into NULL
without having to go into the items file and find/replacing
"NULL" with "\N"  I need a way to do one of two things:  1) When
selecting data from a mysql table, I would like the output to
escape NULLS into the st