title: MySQL query to print output as CSV to standard output
body: <p>I want to do the following <code>mysql -uuser -ppass -h remote.host.tld database &lt; script.sql</code></p>
  
  <p>where <code>script.sql</code> contains the following</p>
  
  <pre><code>SELECT *
  FROM webrecord_wr25mfz_20101011_175524
  FIELDS TERMINATED BY ',' 
  ENCLOSED BY '"' 
  LINES TERMINATED BY '\n'
  </code></pre>
  
  <p>I want CSV output directed to standard out. The reason is because running this query with an <code>INTO OUTFILE 'blah.csv'</code> will save the file on the remote host. I want the file saved on the local host.</p>
  
  <p>If I could just redirect the standard output to a file, that would be dandy.</p>