title: MySQL server has gone away and Error while reading greeting packet
body: <p>I don't know why this :</p>
  <pre><code>$dbh = new PDO('mysql:host=127.0.0.1:1812;dbname=nde_oldy-pn', 'root', '');
  </code></pre>
  <p>throw this exception :</p>
  <pre><code>PDO::__construct(): MySQL server has gone away
  PDO::__construct(): Error while reading greeting packet
  Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2006] MySQL server has gone away'
  PDOException: SQLSTATE[HY000] [2006] MySQL server has gone away
  </code></pre>
  <p>YEAH !! I understand ! MySQL decided to go on a trip without me on his own command ! Grrrr!</p>
  <p>I've tried everything on this page : <a href="https://dev.mysql.com/doc/refman/5.7/en/gone-away.html" rel="nofollow noreferrer">MySQL Documentation (.5.2.9 MySQL server has gone away)</a></p>
  <p>Context :
  It run with WAMP 3.0.6
  (Apache 2.4.23; PHP 7.0.10; MySQL 5.7.14)
  Url like this :</p>
  <blockquote>
  <p>localhost:1812/NDEfiveYEARSproject/index.php</p>
  </blockquote>
  <p>httpd.conf like this :</p>
  <blockquote>
  <p>Listen 12.34.56.78:1812</p>
  <p>Listen 0.0.0.0:1812</p>
  <p>Listen [::0]:1812</p>
  <p>ServerName localhost:1812</p>
  </blockquote>
  <p>my.ini like this :</p>
  <blockquote>
  <p>port = 3306</p>
  <p>key_buffer_size = 64M</p>
  <p>max_allowed_packet = 200M</p>
  </blockquote>
  <p>Yes 1812 and 3306 ports are open.</p>
  <p>Yes Incoming and outbound traffic rules for each port (1812 and 3306) have been created</p>
  <p>IIS is not running</p>
  <p>Same for Skype and Teamviewer...</p>