So I had a website up at http://www.avantalarm.com/ and after many issues trying to add modules, I decided I'd export it to a local WAMP server to work on my development so I didn't break the site while trying to figure things out. I am very new to Magento and figured this would be the best way to do it. After exporting it to my WAMP server via FTP, I noticed that when trying to log into Admin or open the home page I get
There has been an error processing your request
Exception printing is disabled by default for security reasons.
Error log record number: 1489781624
Looking at the error report in var/report/ reveals this code.
a:5:{i:0;s:96:"SQLSTATE[HY000] [1045] Access denied for user 'avant_jonathan'@'localhost' (using password: YES)";i:1;s:1302:"#0 C:\wamp\www\includes\src\__default.php(53987): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 C:\wamp\www\includes\src\__default.php(54460): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 C:\wamp\www\includes\src\__default.php(52674): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 C:\wamp\www\includes\src\__default.php(53730): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 C:\wamp\www\includes\src\__default.php(54566): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 C:\wamp\www\includes\src\__default.php(29302): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 C:\wamp\www\includes\src\__default.php(29243): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 C:\wamp\www\includes\src\Mage_Core_Model_Resource_Setup.php(141): Mage_Core_Model_Resource->getConnection('core_setup')
#8 C:\wamp\www\includes\src\Mage_Core_Model_Resource_Setup.php(234): Mage_Core_Model_Resource_Setup->__construct('core_setup')
#9 C:\wamp\www\includes\src\__default.php(20124): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#10 C:\wamp\www\includes\src\__default.php(20050): Mage_Core_Model_App->_initModules()
#11 C:\wamp\www\app\Mage.php(683): Mage_Core_Model_App->run(Array)
#12 C:\wamp\www\index.php(87): Mage::run('', 'store')
#13 {main}";s:3:"url";s:6:"/admin";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}
I wonder if either a) older files or modules from my old WAMP server are causing the error or b) not all the files copied over correctly. If anyone can help and even possibly help me understand how to read this report, that would be much appreciated. This is also one of my first few questions on StackExchange so if I can reword or add more to my question let me know, I'm excited to learn how to be a contributing member here as I know it will be a valuable resource.
Thanks in advance!
Best Answer
Those error reports are stored in PHP's serialized format — you can unserialize them with code that looks something like this
If you do that, you'll get the items broken out into an array, making it a little easier to read
So, using the above, your error message (the first array index) is
PHP is telling you it can't access the database with the configured information.
Open up
and look for the following section
Change the
host
,username
, andpassword
to match your local settings.For Magento to see your changes, you'll need to clear all the files out of
/path/to/magento/var/cache/*
, as Magento caches the contents oflocal.xml
there.Reload your home page (or any page except the error report page) and you should be good to go. (Or, good to move on to the next exception)