title: Can't connect to docker mysql container via PHP
body: <p>I created a docker container from mysql:5.7 image.</p>
  
  <pre><code>sudo docker run --name mysqltest -e MYSQL_ROOT_PASSWORD=password -v mysql:/var/lib/mysql -d mysql:5.7
  </code></pre>
  
  <p>And I Created a php container that included phpunit</p>
  
  <pre><code>sudo docker run --rm -v $(pwd):/app -w /app phpunit/phpunit:8 phpunit --testdox file.php
  </code></pre>
  
  <p>in file.php I'm trying to connect mysql container, via mysql container ip as host:</p>
  
  <pre><code>sudo docker inspect mysqltest
  </code></pre>
  
  <p>but still I get "connection Refused", but I can connect to mysql container directly via :</p>
  
  <pre><code>sudo docker exec -it mysqltest mysql -ppassword
  </code></pre>
  
  <p>Please Help me, I'm really confused !</p>