title: MySQL in docker-compose -- access denied
body: <p>I try to start <code>MySQL</code> server with <code>docker-compose</code>. Here is <code>docker-compose.yaml</code> part:</p>
  
  <pre><code>  mysql:
      restart: always
      image: mysql:latest
      ports:
      - "3306:3306"
      volumes:
      - /Users/user/Documents/.docker/mysql/config:/etc/mysql/
      - /Users/user/Documents/.docker/mysql/data:/var/lib/mysql
      environment:
      - MYSQL_ROOT_PASSWORD='123'
      - MYSQL_ROOT_HOST='172.18.0.1'
  </code></pre>
  
  <p>You see I've specified root password and host as it is said <a href="https://github.com/mysql/mysql-docker#mysql_root_host" rel="nofollow noreferrer">here</a>. Then I try to connect to db (using Intellij Idea if that matters):</p>
  
  <pre><code>jdbc:mysql://localhost:3306/?user=root&amp;password=123&amp;ssl=false
  </code></pre>
  
  <p>But it doesn't accept the credentials and writes to log:</p>
  
  <pre><code>Access denied for user 'root'@'172.18.0.1' (using password: YES)
  </code></pre>
  
  <p>Please advise on how to fix it. Thanks.</p>