title: WAMP: 'No such host is known' when trying to connect to mysql
body: <p>I got this error :  </p>
  
  <pre><code>Warning: PDO::__construct() [&lt;a href='pdo.--construct'&gt;pdo.--construct&lt;/a&gt;]: [2002] php_network_getaddresses: getaddrinfo failed: No such host is known. (trying to connect via tcp://1:3306) in Z:\work\...
  </code></pre>
  
  <p>My localhost/phpmyadmin works fine but I can't access localhost or 127.0.0.1 , I get a blank page with "Forbidden : You don't have permission to access / on this server."</p>
  
  <p>I have nothing else running on my port 80</p>
  
  <p>I modified my httpd.conf </p>
  
  <pre><code>DocumentRoot "z:/work/"
  
  &lt;Directory /&gt;
      Options FollowSymLinks
      AllowOverride None
      Order deny,allow
      Deny from all
  &lt;/Directory&gt;
  
  &lt;Directory "z:/work/"&gt;
      Options Indexes FollowSymLinks
      AllowOverride all
      Order Deny,Allow
      Deny from all
      Allow from all
  &lt;/Directory&gt;
  </code></pre>
  
  <p>Also added in my httpd-vhosts.conf</p>
  
  <pre><code>&lt;Directory C:/Users/Alex/Documents/GitHub&gt;
  Order Deny,Allow   
  Allow from all 
  AllowOverride All
  &lt;/Directory&gt;
  
  &lt;Directory Z:/work&gt;
  Order Deny,Allow   
  Allow from all 
  AllowOverride All
  &lt;/Directory&gt;
  
  &lt;VirtualHost *:80&gt;
      DocumentRoot "Z:\work\mysite"
      ServerName bullseye.local
  &lt;/VirtualHost&gt;
  
  &lt;VirtualHost *:80&gt;   
  DocumentRoot "C:\Users\Alex\Documents\GitHub\Myproject" 
  ServerName framework.local 
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>And my phpmyadmin.conf is as follow</p>
  
  <pre><code>Alias /phpmyadmin "c:/wamp/apps/phpmyadmin3.5.1/" 
  
  &lt;Directory "c:/wamp/apps/phpmyadmin3.5.1/"&gt;
  Options Indexes FollowSymLinks MultiViews
  AllowOverride all
      Order Deny,Allow
  Deny from all
  Allow from all
  &lt;/Directory&gt;
  </code></pre>
  
  <p>The code giving the error :</p>
  
  <pre><code>$host = 'localhost';
  $user = 'root';
  $pass = '';
  $database = 'mydatabase';
  $this-&gt;db = new PDO('mysql:dbname=' . $database . ';host=' .$host . ';charset=utf8', $user, $pass);
  </code></pre>
  
  <p>I get the same error using mysql or msqli instead of PDO</p>