title: MySQL exporting INTO OUTFILE --secure-file-priv error when using set directory
body: <p>I'm trying to run the following on a MySQL database:</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT * FROM mysql.db
  INTO OUTFILE "C:\ProgramData\MySQL\MySQL Server 5.7\Uploads\db.csv"
  FIELDS TERMINATED BY '|'
  ENCLOSED BY '"'
  LINES TERMINATED BY '\n';
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>SQL Error (1290): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
  </code></pre>
  
  <p>When I run the following:</p>
  
  <pre class="lang-bsh prettyprint-override"><code>mysql&gt; SELECT @@secure_file_priv;
  </code></pre>
  
  <p>I get:</p>
  
  <pre class="lang-sql prettyprint-override"><code>+------------------------------------------------+
  | @@secure_file_priv                             |
  +------------------------------------------------+
  | C:\ProgramData\MySQL\MySQL Server 5.7\Uploads\ |
  +------------------------------------------------+
  </code></pre>
  
  <p>So why is it not exporting the file even though I am using the set --secure-file-priv location?</p>
  
  <p>I am used to MSSQL and new to MySQL. </p>