title: Extra backslash \ when SELECT ... INTO OUTFILE ... in MySQL
body: <p>So I'm trying to export a MySQL table into CSV. I'm using this query:</p>
  
  <pre><code>SELECT * FROM business WHERE id &gt; 0 AND id &lt;= 20000 INTO OUTFILE "business.csv"
  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
  LINES TERMINATED BY "\n";
  </code></pre>
  
  <p>That output something like this:</p>
  
  <p><a href="http://postimage.org/image/2ghyenh5w/full/" rel="noreferrer">http://postimage.org/image/2ghyenh5w/full/</a></p>
  
  <p>The problem with this is that there's always an extra backslash \ where there's newline such as in the address field.</p>
  
  <p>However, CSV exported from phpMyAdmin doesn't have it:</p>
  
  <p><a href="http://postimage.org/image/2gi026tno/full/" rel="noreferrer">http://postimage.org/image/2gi026tno/full/</a></p>
  
  <p>Any way to make the SELECT ... OUTFILE ... do the same? </p>
  
  <p>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. </p>