title: How to fix Error while reading greeting packet?
body: <p>I am trying to connect to server in NetBeans.
  I write the code as below:</p>
  <pre><code>&lt;?php
  echo &quot;wlecome&quot;;
  echo &quot;&lt;br&gt;&quot;;
  
  $conn=mysqli_connect(&quot;mydomain.com:2082&quot;, &quot;phpmyadmin_user&quot;, &quot;password&quot;,&quot;database_name&quot;);
                       
  echo $conn;
  ?&gt;
  </code></pre>
  <p>Running of this code return this erreurs:</p>
  <pre><code>wlecome
  
  Warning: mysqli_connect(): MySQL server has gone away in C:\xampp\htdocs\myprojet\index.php on line 10
  
  Warning: mysqli_connect(): Error while reading greeting packet. PID=1092 in C:\xampp\htdocs\myprojet\index.php on line 10
  
  Warning: mysqli_connect(): (HY000/2006): MySQL server has gone away in C:\xampp\htdocs\myprojet\index.php on line 10
  
  Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\myprojet\index.php on line 10
  </code></pre>