title: SQLSTATE[28000] [1045] (Magento) Access denied for user .. (but new PDO, works in test program)
body: <p>I copied a Magento store to another provider and installed the database. Nothing special.</p>
  
  <p>With testing always this error for the mysql database: </p>
  
  <pre><code>SQLSTATE[28000] [1045] Access denied for user ‘xx’@’localhost’ (using password: YES)
  </code></pre>
  
  <p>I found this program <code>/httpdocs/lib/Zend/Db/Adapter/Pdo/Abstract.php</code> and has this statement:</p>
  
  <pre><code>try { 
      $this-&gt;_connection = new PDO( 
      $dsn, 
      $this-&gt;_config[’username’], 
      $this-&gt;_config[’password’], 
      $this-&gt;_config[’driver_options’] 
  ); 
  </code></pre>
  
  <p>If I use the same statement with the same settings in a short test program on the same server, the connection works.</p>
  
  <p>How is this possible? Is there something in PDO different working while called in Magento?</p>
  
  <p>I forgot to write, this domain has only a shared IP address and a domain name (but no DNS yet), so I coupled this IP address to this domain name in windows hosts file. So domain www.xxxx.com exists on the internet already, I use xxxx.com in windows host file coupled to the shared IP address. In this way I tested always new websites without an transferred domain yet. </p>
  
  <p>When I copy everything to my own server (localhost.com for Magento), I have to find it, all works well. So it has something to do with the situation at my provider ... but why it is working in my own test program for PDO with the same settings ?   </p>
  
  <p>$dsn =  mysql:model=mysql4;initStatements=SET NAMES utf8;type=pdo_mysql;host=localhost;dbname=xxxx;active=1 </p>