title: Magento Error: SQLSTATE[HY000] [1045] Access denied for user 'MYSITE_magento'@'localhost' (using password: YES)
body: <p>I have copied a magento site from one server to another, hoping to make a carbon copy of a shop.</p>
  
  <p>I exported/imported the database via phpMyAdmin and I zipped and unzipped the site files.</p>
  
  <p>Everything is there. I have doubled checked the db passwords and details. I have also checked all of the file/folder permissions are correct. Still I get the error.</p>
  
  <p>This error says ...</p>
  
  <pre><code> There has been an error processing your request
   Exception printing is disabled by default for security reasons.
  </code></pre>
  
  <p>Here are the contents of my Magento error log:</p>
  
  <pre><code>a:4:{i:0;s:97:
  "SQLSTATE[HY000] [1045] Access denied for user 'MYSITE_magento'@'localhost' (using password: YES)"
  ;i:1;s:2792:"
  #0 /home/MYSITE/public_html/lib/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract-&gt;_connect()
  #1 /home/MYSITE/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(251): Zend_Db_Adapter_Pdo_Mysql-&gt;_connect()
  #2 /home/MYSITE/public_html/lib/Zend/Db/Adapter/Abstract.php(448): Varien_Db_Adapter_Pdo_Mysql-&gt;_connect()
  #3 /home/MYSITE/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract-&gt;query('SET NAMES utf8', Array)
  #4 /home/MYSITE/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(333): Zend_Db_Adapter_Pdo_Abstract-&gt;query('SET NAMES utf8', Array)
  #5 /home/MYSITE/public_html/app/code/core/Mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php(45): Varien_Db_Adapter_Pdo_Mysql-&gt;query('SET NAMES utf8')
  #6 /home/MYSITE/public_html/app/code/core/Mage/Core/Model/Resource.php(93): Mage_Core_Model_Resource_Type_Db_Pdo_Mysql-&gt;getConnection(Object(Mage_Core_Model_Config_Element))
  #7 /home/MYSITE/public_html/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(297): Mage_Core_Model_Resource-&gt;getConnection('core_read')
  #8 /home/MYSITE/public_html/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(312): Mage_Core_Model_Mysql4_Abstract-&gt;_getConnection('read')
  #9 /home/MYSITE/public_html/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(332): Mage_Core_Model_Mysql4_Abstract-&gt;_getReadAdapter()
  #10 /home/MYSITE/public_html/app/code/core/Mage/Core/Model/Mysql4/Collection/Abstract.php(97): Mage_Core_Model_Mysql4_Abstract-&gt;getReadConnection()
  #11 /home/MYSITE/public_html/app/code/core/Mage/Core/Model/Config.php(1206): Mage_Core_Model_Mysql4_Collection_Abstract-&gt;__construct(Object(Mage_Core_Model_Mysql4_Website))
  #12 /home/MYSITE/public_html/app/code/core/Mage/Core/Model/Config.php(1239): Mage_Core_Model_Config-&gt;getModelInstance('core_mysql4/web...', Object(Mage_Core_Model_Mysql4_Website))
  #13 /home/MYSITE/public_html/app/Mage.php(460): Mage_Core_Model_Config-&gt;getResourceModelInstance('core/website_co...', Object(Mage_Core_Model_Mysql4_Website))
  #14 /home/MYSITE/public_html/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel('core/website_co...', Object(Mage_Core_Model_Mysql4_Website))
  #15 /home/MYSITE/public_html/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract-&gt;getResourceCollection()
  #16 /home/MYSITE/public_html/app/code/core/Mage/Core/Model/App.php(532): Mage_Core_Model_Abstract-&gt;getCollection()
  #17 /home/MYSITE/public_html/app/code/core/Mage/Core/Model/App.php(393): Mage_Core_Model_App-&gt;_initStores()
  #18 /home/MYSITE/public_html/app/code/core/Mage/Core/Model/App.php(299): Mage_Core_Model_App-&gt;_initCurrentStore('', 'store')
  #19 /home/MYSITE/public_html/app/Mage.php(596): Mage_Core_Model_App-&gt;run(Array)
  #20 /home/MYSITE/public_html/index.php(80): Mage::run('', 'store')
  #21 {main}
  ";s:3:"url";s:10:"/~MYSITE/";s:11:"script_name";s:19:"/~MYSITE/index.php";}
  </code></pre>
  
  <p>Obviously I replaced my site name above with MYSITE.</p>