Laravel Connection Refused Error
<p>I'm aware this is a repeat question, but none of the solutions online seem to be working for me.</p>

<p>I'm trying to add authentication to a laravel 5 project (using <code>make:auth</code>)
Whenever I try to 'register', I get a <code>SQLSTATE[HY000] [2002] Connection refused</code> error.</p>

<p>The responses online have been to change localhost to 127.0.0.1 and vise-vera, but that isn't working for me.</p>

<p>Any idea anyone?
Thanks (I'm on OSX, if that makes a difference at all)</p>

<pre><code>.env
DB_HOST=localhost
DB_DATABASE=test
DB_USERNAME=test
DB_PASSWORD=
</code></pre>

<p></p>

<pre><code>database.php
'mysql' =&gt; [
            'driver'    =&gt; 'mysql',
            'host'      =&gt; env('DB_HOST', 'localhost'),
            'database'  =&gt; env('DB_DATABASE', 'test'),
            'username'  =&gt; env('DB_USERNAME', 'test'),
            'password'  =&gt; env('DB_PASSWORD', ''),
            'charset'   =&gt; 'utf8',
            'collation' =&gt; 'utf8_unicode_ci',
            'prefix'    =&gt; '',
            'strict'    =&gt; false,
        ],
</code></pre>