title: How to overwrite the existing CSV file with new file while export from MYSQL
body: <p>I have to export the MySQL table data into CSV file for every 5 minutes with same file location and file name.
  I run the following query to export:</p>
  
  <pre><code>SELECT *  INTO OUTFILE ' c:/newfolder/matrix.csv ' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' FROM tablename
  </code></pre>
  
  <p>When I export the data, first time it exported correctly, but second time it shows the error "SQL Error(1086) File:' c:/newfolder/matrix.csv ' already exists". I need to overwrite the existing file.</p>
  
  <p>Can any one help to solve this problem?</p>