title: Docker MySQL 8 how to set --secure-file-priv
body: <p>I would like to solve this problem:</p>
  
  <blockquote>
    <p>ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement</p>
  </blockquote>
  
  <p>with the <a href="https://github.com/docker-library/mysql/blob/a7a737f1eb44db467c85c8229df9d886dd63460e/8.0/Dockerfile" rel="noreferrer">official MySQL 8</a> image on docker.</p>
  
  <p>the command:</p>
  
  <pre><code>SHOW VARIABLES LIKE "secure_file_priv";
  </code></pre>
  
  <p>gives:</p>
  
  <pre><code>+------------------+-------+
  | Variable_name    | Value |
  +------------------+-------+
  | secure_file_priv | NULL  |
  +------------------+-------+
  1 row in set (0.01 sec)
  </code></pre>
  
  <p>Is it possible to overwrite the default value NULL for the --secure-file-priv by using the official MySQL 8 Docker image?</p>
  
  <p>the default value in this image is set to NULL
  <a href="https://github.com/docker-library/mysql/blob/master/8.0/config/my.cnf#L26" rel="noreferrer">config/my.cnf</a></p>
  
  <p>Perfectly I would like to set just an environmental variable or parameter when using docker run or create instead of bringing my own config file.</p>
  
  <p>but if this is not possible then how to use custom config file?
  is it possible that custom file just overwrites this one parameter and leaves others as they are in the official image config?</p>