title: Permission denied while exporting csv file from mySQL (MariaDB) to targeted folder
body: <p>My understanding is that exporting a file (e.g. csv) from <code>MariaDB</code> is restricted to specified folders by default. Thus, I have been accessing my exported files at the <code>tmp</code> folder so far. I wanted to ask if there was a way to change this to another folder i.e. <code>/home/user/projects</code>? I am using Raspbian Stretch as my OS. As a root user of my <code>SQL databas</code>e, I checked that I have full grant privileges. </p>
  
  <pre><code>+---------------------------------------------------------------------+
  | Grants for root@localhost                                           |
  +---------------------------------------------------------------------+
  | GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION |
  | GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION       |
  +---------------------------------------------------------------------+
  </code></pre>
  
  <p>However, when I query with <code>
  MariaDB [mydatabase]&gt; SELECT * from table1 into outfile '/home/user/projects/file1.csv';</code>, I get this error:</p>
  
  <p><code>ERROR 1 (HY000): Can't create/write to file '/home/user/projects/file1.csv' (Errcode: 13 "Permission denied")</code>, </p>
  
  <p>Is there something else I can do to be able to export my files to a folder of my choosing?</p>
  
  <p><strong>Updates</strong>: So far, I tried chmod 755 and 777 methods and creating a new user in the SQL client with granting of full privileges and file (and then logging in as that user to make the query), but have had no success .</p>