title: Where does MySQL on OSX write outfiles by default?
body: <p>I'm trying to write some data from a MySQL select statement to a file on a Mac running Snow Leopard.</p>
  
  <pre><code>select date_base, fractile_v2, gics, count(gvkey_iid)
  from master
  where fractile_v2 &lt;= 15 and
        fractile_v2  != 0
  group by date_base, gics, fractile_v2
  order by date_base, fractile_v2
  limit 100000
  INTO OUTFILE '/User/my-name/Desktop/gics_v2.csv'
  FIELDS TERMINATED BY ',';
  </code></pre>
  
  <p>Unfortunately this generates the following error:</p>
  
  <blockquote>
    <p>Error Code: 1. Can't create/write to file '/Users/andrew/Desktop/gics_v2.csv' (Errcode: 13)</p>
  </blockquote>
  
  <p>which I'm assuming is a permissions issue.</p>
  
  <p>When I replace the full file path <code>'/User/my-name/Desktop/gics_v2.csv'</code> with simply <code>gics_v2.csv</code> the statements seems to run. However I have no idea where the file is saved and I can't find it.</p>
  
  <p>Does anyone know? And can anyone also suggest how I can solve the initial write error? I'm running MySQL as the root user.</p>