mysqli_connect(): (HY000/2002): No connection could be made because the target machine actively refused it
<p>I know there are many questions like this, but i didn't find any solution in it.</p>

<p>Things i tried:-</p>

<ul>
<li><p>checked firewall</p></li>
<li><p>restarted my PC and Apache server</p></li>
<li><p>restarted MYSQL</p></li>
<li><p>checked my code</p></li>
<li><p>Tried everything i know and found on internet</p></li>
</ul>

<p>here's my code:-</p>

<pre><code>&lt;?php

$dbhost = 'localhost:3360';
$dbuser = 'root';
$dbpass = '';
$db     = 'test_db13';


$conn  = mysqli_connect($dbhost,$dbuser,'',$db);

if(! $conn){
  die('Could not connect connect: ') ;
}

echo 'Successfully Connected';


$sql = 'Connected Successfully';
  $retvalue = mysqli_query($sql);

  if(! $retvalue){
    die('Cannot connect to SQL: ');
  }

echo 'DataBase test_db13 has successfully created';

mysqli_close($conn);

 ?&gt;
</code></pre>

<p>I did set the password, but it still is showing me the error.</p>

<p>Here's the firewall picture:-
<img src="https://i.stack.imgur.com/gul1d.png" alt="enter image description here"></p>

<p>lastly XAMMP is running here's the proof</p>

<p><img src="https://i.stack.imgur.com/wfQgs.png" alt="enter image description here"></p>