title: PHP SQLSTATE[HY000] [1045] Access denied for user Laravel
body: <p>I'm working on a project (PHP Laravel 4.2) using SVN with team, After I checked out the repository on my disk (local), and tried to open the link <code>localhost/mylaravel</code>, I got this error</p>
  
  <blockquote>
    <p>PDOException (1045)  SQLSTATE[HY000] [1045] Access denied for user
    'dbusername'@'xx.xxx.xx.xxx' (using password: YES)</p>
  </blockquote>
  
  <p>Note: I changed the real username and host IP </p>
  
  <p>the database not locally, It's remotely hosted online. but the project is on localhost. </p>
  
  <p>config/database.php</p>
  
  <pre><code>'connections' =&gt; array(
  
          'sqlite' =&gt; array(
              'driver'   =&gt; 'sqlite',
              'database' =&gt; __DIR__.'/../database/production.sqlite',
              'prefix'   =&gt; '',
          ),
  
          /**
           * remote database connection
           */
          'mysql' =&gt; array(
              'driver'    =&gt; 'mysql',
              'host'      =&gt; 'hostIP:port',
              'database'  =&gt; 'mydatabasename',
              'username'  =&gt; 'mydbusername',
              'password'  =&gt; 'root123456',
              'charset'   =&gt; 'utf8',
              'collation' =&gt; 'utf8_unicode_ci',
              'prefix'    =&gt; '',
          ),
  
          'pgsql' =&gt; array(
              'driver'   =&gt; 'pgsql',
              'host'     =&gt; 'localhost',
              'database' =&gt; 'forge',
              'username' =&gt; 'forge',
              'password' =&gt; '',
              'charset'  =&gt; 'utf8',
              'prefix'   =&gt; '',
              'schema'   =&gt; 'public',
          ),
  
          'sqlsrv' =&gt; array(
              'driver'   =&gt; 'sqlsrv',
              'host'     =&gt; 'localhost',
              'database' =&gt; 'database',
              'username' =&gt; 'root',
              'password' =&gt; '',
              'prefix'   =&gt; '',
          ),
  
      )
  </code></pre>