title: How come mysqldump into a file doesn't work within the docker container (with an unintuitive error message)?
body: <p>When using the <code>mysql:5.7</code> docker image, I go into the docker container by doing <code>exec -it /bin/sh</code> to try to dump out a backup of the database. I have a volume mounted on <code>/share</code>, which is where I am attempting to save the dump file.</p>
  <p>If I do the following:</p>
  <pre class="lang-sh prettyprint-override"><code>mysqldump -u user -ppassword database
  </code></pre>
  <p>Then I successfully see a dump of the database being printed on the screen.</p>
  <p>If I do the following:</p>
  <pre class="lang-sh prettyprint-override"><code>echo &quot;hello world&quot; &gt; /share/dump.sql
  </code></pre>
  <p>Then I successfully see the <code>/share/dump.sql</code> file containing <code>hello world</code>.</p>
  <p>But if I try to combine that into:</p>
  <pre class="lang-sh prettyprint-override"><code>mysqldump -u user -ppassword database &gt; /share/dump.sql
  </code></pre>
  <p>Then I get a seemingly unrelated error, saying:</p>
  <blockquote>
  <p>Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces</p>
  </blockquote>
  <p>Obviously it's not a case of missing privileges, since my <code>mysqldump</code> call without saving into a file works. So, what gives?</p>
  <p>For anyone wanting to try it out, here's the relevant compose file:</p>
  <pre class="lang-yaml prettyprint-override"><code>version: '3.8'
  
  services:
    db:
      image: mysql:5.7
      environment:
        MYSQL_DATABASE: database
        MYSQL_USER: user
        MYSQL_PASSWORD: password
        MYSQL_ROOT_PASSWORD: root
      volumes:
        - ./share:/share
  
  volumes:
    db:
  </code></pre>