sqlstate[hy000] [2002] connection refused in laravel 5.2.29 trying migrations
<p>I'm trying to execute migrations in my laravel_cms example database </p>

<p>I put the correct parameters in the <code>.env</code> file in my project</p>

<pre><code>DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=8889
DB_DATABASE=laravel_cms
DB_USERNAME=root
DB_PASSWORD=password
</code></pre>

<p>The default password in MAMP PRO to root user is root but I have changed it. But that is not a problem because I access using terminal with tag password</p>

<p>The port than MAMP PRO uses is 8889</p>

<p>But when I execute this command in the larval project: 
    php artisan migrate</p>

<p>I get this error</p>

<blockquote>
  <p>[PDOException]<br>
  SQLSTATE[HY000] [2002] Connection refused  </p>
</blockquote>

<p>Any idea please?</p>

<p>Regards</p>