title: Connection to DB with socket refused in Laravel
body: <p>I'm aware of a ton of hits on SO and Google about this issue, still I have a unique problem it seems.</p>
  
  <p>Error message:
  SQLSTATE[HY000] [2002] Connection refused</p>
  
  <p>Configuration</p>
  
  <pre><code>    'mysql' =&gt; array(
          'driver'    =&gt; 'mysql',
          "host"      =&gt; "localhost:/var/run/mysqld4.sock",
          'port'      =&gt; '3304',
          "username"  =&gt; "admin",
          "password"  =&gt; "admin",
          "database"  =&gt; "frontend_generic",
          'charset'   =&gt; 'utf8',
          'collation' =&gt; 'utf8_unicode_ci',
          'prefix'    =&gt; 'pre_',
      ),
  </code></pre>
  
  <p>I confirmed that my database is running on port 3304, my prefix is correct, as are user, database and password.</p>
  
  <p>For host I tried "localhost", "127.0.0.1", "<a href="http://127.0.0.1" rel="noreferrer">http://127.0.0.1</a>" and even the actual ip-address of the server.</p>
  
  <p>Still, there is no luck or change. I tried using the exact same configuration in the local database.php file, but as expected, nothing changes.</p>
  
  <p>Out of options, what am I missing here?</p>
  
  <p>Update:</p>
  
  <p>This is code from another app that works with this configuration. This is Kohana, not Laravel, but it works.</p>
  
  <pre><code> "general" =&gt; array
          (
              "type"       =&gt; "mysql",
              "connection" =&gt; array
              (
                  "hostname"   =&gt; "localhost:/var/run/mysqld4.sock",
                  "username"   =&gt; "admin",
                  "password"   =&gt; "admin",
                  "persistent" =&gt; FALSE,
                  "database"   =&gt; "frontend_generic",
              ),
              "table_prefix" =&gt; "pre_",
              "charset"      =&gt; "utf8",
              "caching"      =&gt; FALSE,
              "profiling"    =&gt; TRUE,
          ),
  </code></pre>