Magento错误:SQLSTATE [HY000] [2002]无法建立连接,因为目标计算机主动拒绝它

时间:2016-01-05 06:37:58

标签: mysql apache magento

我将mysql 3306的端口更改为3307,然后将此localhost url更改为Magento。

出于安全原因,默认情况下禁用异常打印。 错误日志记录号:1108316134

a:4:{i:0;s:100:
"SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it.";i:1;s:2928:"
#0 C:\xampp\htdocs\magento\lib\Zend\Db\Adapter\Pdo\Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 C:\xampp\htdocs\magento\lib\Varien\Db\Adapter\Pdo\Mysql.php(396): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 C:\xampp\htdocs\magento\lib\Zend\Db\Adapter\Abstract.php(460): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 C:\xampp\htdocs\magento\lib\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 C:\xampp\htdocs\magento\lib\Varien\Db\Adapter\Pdo\Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Resource.php(179): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#8 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(360): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Resource\Db\Collection\Abstract.php(134): Mage_Core_Model_Resource_Db_Abstract->getReadConnection()
#12 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Config.php(1348): Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Object(Mage_Core_Model_Resource_Website))
#13 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Config.php(1380): Mage_Core_Model_Config->getModelInstance('core_resource/w...', Object(Mage_Core_Model_Resource_Website))
#14 C:\xampp\htdocs\magento\app\Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#15 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Abstract.php(208): Mage::getResourceModel('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#16 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
#17 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\App.php(619): Mage_Core_Model_Abstract->getCollection()
#18 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\App.php(477): Mage_Core_Model_App->_initStores()
#19 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Model\App.php(360): Mage_Core_Model_App->_initCurrentStore('', 'store')
#20 C:\xampp\htdocs\magento\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#21 C:\xampp\htdocs\magento\index.php(83): Mage::run('', 'store')
#22 {main}";
s:3:"url";s:78:"/magento/index.php/admin/dashboard/index/key/008099640c2b60fc343428e925bb560f/";s:11:"script_name";s:18:"/magento/index.php";}

1 个答案:

答案 0 :(得分:0)

似乎PDO Extension服务器上的xampp未启用。

请参阅PHP PDO installation on windows (xampp)以启用它。

如果您引用位于\var\report\1108316134.log的错误日志文件,则会明确说明错误是什么。