title: Docker - Can't access MySQL CLI in container
body: <p>In my MySQL container that I have configured per the <a href="https://registry.hub.docker.com/_/mysql/" rel="nofollow noreferrer">official image</a>, it does not allow me to access the CLI from my host machine, nor any other of my containers, despite being linked:</p>
  
  <p><img src="https://i.stack.imgur.com/86mRs.png" alt="Access denied for user &#39;root&#39;@&#39;172.17.0.3&#39;"></p>
  
  <p>Now, I know that I have not configured external access on my MySQL container, but how can I configure it if I can't even access the CLI to grant myself permissions? Could I create a <code>Dockerfile</code> and change some system settings before the initial installation of MySQL? If so, how would I go about doing that?</p>
  
  <p>My <code>fig.yml</code> file, which is used to set up my MySQL container:</p>
  
  <pre><code>mysql:
    image: mysql:latest
    volumes:
      - .:/mydir
    working_dir: /mydir
    ports:
      - "3306:3306"
    environment:
      - MYSQL_DATABASE=mydb
      - MYSQL_ROOT_PASSWORD=mypass
  </code></pre>