title: Access denied for user 'homestead'@'localhost' (using password: YES)
body: <p>I'm on a Mac OS Yosemite using Laravel 5.0.</p>
  <p>While in my <strong>local</strong> environment, I run <code>php artisan migrate</code> I keep getting :</p>
  <blockquote>
  <p>Access denied for user 'homestead'@'localhost' (using password: YES)</p>
  </blockquote>
  <p><strong>Configuration</strong></p>
  <p>Here is my <strong>.env</strong></p>
  <pre><code>APP_ENV=local
  APP_DEBUG=true
  APP_KEY=*****
  
  DB_HOST=localhost
  DB_DATABASE=homestead
  DB_USERNAME=homestead
  DB_PASSWORD=secret
  </code></pre>
  <p><strong>app\config\database.php</strong></p>
  <pre><code>   'mysql'       =&gt; [
      'driver'      =&gt; 'mysql',
      'host'        =&gt; env('DB_HOST', 'localhost'),
      'database'    =&gt; env('DB_DATABASE', 'homestead'),
      'username'    =&gt; env('DB_USERNAME', 'homestead'),
      'password'    =&gt; env('DB_PASSWORD', 'secret'),
      'unix_socket' =&gt; '/tmp/mysql.sock',
      'charset'     =&gt; 'utf8',
      'collation'   =&gt; 'utf8_unicode_ci',
      'prefix'      =&gt; '',
      'strict'      =&gt; false,
      ]
  </code></pre>
  <p>How do I avoid this kind of error ?</p>
  <p><strong>I've tried :</strong></p>
  <hr />
  <h1>1</h1>
  <p>in <strong>app/database.php</strong></p>
  <p>Replace <code>localhost</code> with <code>127.0.0.1</code></p>
  <p><code>'host'=&gt; env('DB_HOST', 'localhost')</code> --&gt;<code>'host' =&gt; env('DB_HOST', '127.0.0.1')</code></p>
  <p>Also, in <strong>.env</strong></p>
  <p><code>DB_HOST=localhost</code>  --&gt; <code>DB_HOST=127.0.0.1</code></p>
  <hr />
  <h1>2</h1>
  <p>Try specify environment</p>
  <p><code>php artisan migrate --env=local</code></p>
  <hr />
  <h1>3</h1>
  <p>Check to see if the MySQL is running by run</p>
  <p><code>mysqladmin -u homestead -p status Enter password: secret</code></p>
  <p>I got</p>
  <p><code>Uptime: 21281 Threads: 3 Questions: 274 Slow queries: 0 Opens: 327 Flush tables: 1 Open tables: 80 Queries per second avg: 0.012</code></p>
  <p>Which mean it's running.</p>
  <hr />
  <h1>4</h1>
  <p>Check MySQL UNIX Socket (<em>This step work for me</em>)</p>