title: Laravel PDOException error in Connector.php line 55
body: <p>I am beginner in <strong>Laravel PHP framework</strong>.That's why i am trying basic task from <a href="https://laravel.com/docs/5.2/quickstart#introduction" rel="nofollow noreferrer">HERE (Laravel.com)</a> .I followed this basic task step by step.But after finishing this i am getting an <em>error</em>. I am putting the <em>error</em> here.</p>
  <blockquote>
  <p>PDOException in
  C:\xampp\htdocs\quickstart\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php
  line 55: SQLSTATE[HY000] [1045] Access denied for user
  'homestead'@'localhost' (using password: YES)</p>
  </blockquote>
  <p>What is the meaning of this error?</p>
  <pre><code>SQLSTATE[HY000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)
  </code></pre>
  <p>Here is my <strong>.env</strong> file.</p>
  <pre><code>DB_HOST=localhost
  DB_DATABASE=laravel
  DB_USERNAME=root
  DB_PASSWORD=
  </code></pre>
  <p>I have found similar problem in <a href="https://stackoverflow.com/questions/30200208/pdoexception-in-connector-php-line-47-sqlstatehy000-1045-access-denied-for">here</a>. But there is no proper solution of it.</p>
  <p>Here i add few lines <em>(48 to 63)</em> from <strong>Connector.php</strong> .</p>
  <pre><code>public function createConnection($dsn, array $config, array $options)
  {
      $username = Arr::get($config, 'username');
  
      $password = Arr::get($config, 'password');
  
      try {
          $pdo = new PDO($dsn, $username, $password, $options);
      } catch (Exception $e) {
          $pdo = $this-&gt;tryAgainIfCausedByLostConnection(
              $e, $dsn, $username, $password, $options
          );
      }
  
      return $pdo;
  }
  </code></pre>
  <p>Really I do get right solution of it. Can anyone give me the right solution to it? BTW this is laravel 5.2.</p>