title: How to connect multiple docker container using link?
body: <p>I am trying to <code>link</code> mysql and php/nginx docker containers.
  Here is the command I am running to connect the containers:</p>
  
  <pre><code>docker run -p 127.0.0.1:3005:80 --name nginxTest --link mysqlTest ubuntu
  </code></pre>
  
  <p>The php container contains this php file:</p>
  
  <pre><code>&lt;?php
      $servername = "mysqlTest";
      $username = "root";
      $password = "";
  
      // Create connection
      $conn = new mysqli($servername, $username, $password);
  
      // Check connection
      if ($conn-&gt;connect_error) {
          die("Connection failed: " . $conn-&gt;connect_error);
      } 
      echo "Connected successfully";
  ?&gt;
  </code></pre>
  
  <p>But I am getting this error on accessing <code>127.0.0.1:3005</code>:</p>
  
  <pre><code>Connection failed: MySQL server has gone away
  </code></pre>
  
  <p>What am I doing wrong?</p>