title: SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)
body: <p>I am fairly new to Laravel framework. I keep getting this error when trying to register a user. I am able to do table migration so I know the connection works.Below is the info I have in my .env file. I am able to successfully migrate too, check below.</p>
  
  <pre><code>DB_CONNECTION=mysql
  DB_HOST=127.0.0.1
  DB_PORT=3306
  DB_DATABASE=classified
  DB_USERNAME=root
  DB_PASSWORD=null
  </code></pre>
  
  <p>current config of database.php file</p>
  
  <pre><code>'mysql' =&gt; [
          'driver' =&gt; 'mysql',
          'host' =&gt; env('DB_HOST', '127.0.0.1'),
          'port' =&gt; env('DB_PORT', '3306'),
          'database' =&gt; env('DB_DATABASE', 'classified'),
          'username' =&gt; env('DB_USERNAME', 'root'),
          'password' =&gt; env('DB_PASSWORD', null),
          'charset' =&gt; 'utf8mb4',
          'collation' =&gt; 'utf8mb4_unicode_ci',
          'prefix' =&gt; '',
          'strict' =&gt; true,
          'engine' =&gt; null,
      ],
  </code></pre>
  
  <p>The database also holds the migrated SQL files. So the connection works, however actually trying to register or login throws that error.</p>
  
  <pre><code>1/2
  PDOException in Connector.php line 68:
  SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)
  
  2/2
  QueryException in Connection.php line 647:
  SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES) (SQL: select count(*) as aggregate from `users` where `email` = user@gmail.com)
  </code></pre>
  
  <p>I am using <strong>MySQL</strong> and <strong>not</strong> using <strong>Homestead</strong>.I do not know where exactly it's getting the information from that it's trying to use, but if its not from the .env. This is a new install made minutes ago. All I did was enter the MySQL data in, perform auth, migrate to register. I am using Laravel 5.4</p>