title: 2005 Unknown MySQL server host '127.0.0.1:3306' (11001)'
body: <p>Yeah,</p>
  
  <p>I have the following error:</p>
  
  <blockquote>
    <p>Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2005] Unknown MySQL server host '127.0.0.1:3306' (11001)' in C:\xampp\htdocs\php.php:5 Stack trace: #0 C:\xampp\htdocs\php.php(5): PDO->__construct('mysql:host=127....', 'root', 'pass') #1 {main} thrown in C:\xampp\htdocs\php.php on line 5</p>
  </blockquote>
  
  <p>php.php contains the following:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>error_reporting(E_ALL);
  ini_set('display_errors', 1);
  
  /* Database Setting */
  $db['host'] = '127.0.0.1'; //Mysql's Host
  $db['port'] = '3306'; //Mysql's port
  $db['user'] = "root"; //Mysql's user
  $db['pass'] = 'pass'; //Mysql's password
  $db['db'] = "db"; //Mysql's database
  
  $dbh = new PDO('mysql:host='.$db['host'].':'.$db['port'].';dbname='.$db['db'].'', $db['user'], $db['pass']);</code></pre>
  </div>
  </div>
  </p>
  
  <p>I found some other posts but those were with the same error but then with <code>localhost</code> instead of <code>127.0.0.1</code> its really weird, can you guys please help me out?</p>
  
  <p>Thanks!</p>