So I'm trying to export a MySQL table into CSV. I'm using this query:
SELECT * FROM business WHERE id > 0 AND id <= 20000 INTO OUTFILE "business.csv"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY "\n";
That output something like this:
http://postimage.org/image/2ghyenh5w/full/
The problem with this is that there's always an extra backslash \ where there's newline such as in the address field.
However, CSV exported from phpMyAdmin doesn't have it:
http://postimage.org/image/2gi026tno/full/
Any way to make the SELECT ... OUTFILE ... do the same?
The table I'm dealing with has 20 million records, phpMyAdmin can only handle about 500,000 records for every export action - or it will go blank or mysql server gone away, etc.