title: How to output sql query to csv file and make is accessible
body: <p>Is there a way to output the result of an SQL query to a CSV file and make it accessible?</p>
  <p>I output an SQL result from MySQL to CSV file but the file was not accessible</p>
  <pre><code>select date,str_location, lc_prof\
  from clean_store\
  where date='2019-11-26'\
  order by lc_prof into outputfile 'location_wise_profit.csv' FIELDS TERMINATED BY ',' LINES 
  TERMINATED  BY '\n';
  </code></pre>
  <p>it ran successfully but the output file cannot be accessed by other applications.</p>
  <p>It shows <strong>permission denied</strong> when trying to access it by other applications.</p>
  <p><a href="https://i.stack.imgur.com/WkmSv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WkmSv.png" alt="enter image description here" /></a></p>