title: DatabaseError: 1 (HY000): Can't create/write to file '2015-04-06 20:48:33.418000'.csv (Errcode: 13 - Permission denied)
body: <p>I am designing an application in Python and trying to write to a CSV file, but I am getting this error: </p>
  
  <blockquote>
    <p>DatabaseError: 1 (HY000): Can't create/write to file '2015-04-06 20:48:33.418000'.csv (Errcode: 13 - Permission denied)</p>
  </blockquote>
  
  <p>The Code:</p>
  
  <pre><code>def generate_report(self):
          conn=mysql.connector.connect(user='root',password='',host='localhost',database='mydatabase')     
          exe2 = conn.cursor()
          exe2.execute("""SELECT tbl_site.Site_name, State_Code, Country_Code,Street_Address, instrum_start_date, instrum_end_date, Comment INTO OUTFILE  %s FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\\\' LINES TERMINATED BY '\\n'FROM tbl_site JOIN tbl_site_monit_invent ON site_id = tbl_Site_site_id """, (str(datetime.datetime.now()),))
  </code></pre>
  
  <p>I can run this code without any errors on a Mac, but I need it to work on Windows.</p>
  
  <p>How can I resolve this error?</p>