title: Unable to connect to mysql in docker container from another docker container
body: <p>I have two docker containers: mysql and spring boot service.<br>
  Service container is not connecting to mysql container(failing on the deploy) with following exception:
  <code>CommunicationsException: Communications link failure</code><br>
  So far I have tried using docker --link, docker networks, running everything using/without docker compose. 
  I am able to connect to DB container outside of docker.</p>
  
  <p>Connection string: <code>jdbc:mysql://db:3306/somedb</code></p>
  
  <p>docker-compose.yml</p>
  
  <pre><code>version: '3.7'
  services:
    app:
      build: .
      restart: unless-stopped
      ports:
      - "80:8060"
      links:
      - db
      depends_on:
      - db
  
    db:
      image: "mysql:latest"
      command: --default-authentication-plugin=mysql_native_password
      environment:
      - MYSQL_DATABASE=somedb
      - MYSQL_ROOT_PASSWORD=somepassword
      ports:
      - "3306:3306"
      volumes:
      - /Users/someuser/someproject/mysql/data:/var/lib/mysql
  </code></pre>