title: Laravel: SQLSTATE HY000 2002 No connection could be made because the target machine actively refused it
body: <p>I am trying to migrate migrations to MySQL database using <code>php artisan migrate</code> in Laravel 5.2's Homestead on my local machine. I keep getting this error:</p>
  
  <pre><code>[PDOException]
  
  SQLSTATE[HY000] [2002] No connection could be made because the target machine 
  actively refused it.
  </code></pre>
  
  <p>I can connect to the database just fine using MySQL workbench, but I want to use laravel's migration feature.</p>
  
  <p>My <code>database.php</code> looks like this:</p>
  
  <pre><code>    'mysql' =&gt; [
          'driver' =&gt; 'mysql',
          'host' =&gt; env('DB_HOST', '192.168.10.10'),
          'port' =&gt; env('DB_PORT', '33060'),
          'database' =&gt; env('DB_DATABASE', 'laraveldb'),
          'username' =&gt; env('DB_USERNAME', 'homestead'),
          'password' =&gt; env('DB_PASSWORD', 'secret'),
          'charset' =&gt; 'utf8',
          'collation' =&gt; 'utf8_unicode_ci',
          'prefix' =&gt; '',
          'strict' =&gt; false,
          'engine' =&gt; null,
      ],
  </code></pre>
  
  <p>Has anyone had this problem before?</p>