我遇到了Magento迁移的问题,我正在开发一个主题并上传一些产品,一切正常。
问题是,当我尝试将生态系统从dev移动到prod时,我克隆了Amazon EC2实例和Amazon RDS数据库,然后在prod实例中我将数据库指向prod实例并且它停止工作。我更改了app/etc/local.xml
上的数据库详细信息,我删除了缓存和会话,并且它一直显示
a:4:{i:0;s:43:"SQLSTATE[HY000] [2002] Connection timed out";i:1;s:2493:"#0 /opt/bitnami/apache2/htdocs/lib/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /opt/bitnami/apache2/htdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(396): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /opt/bitnami/apache2/htdocs/lib/Zend/Db/Adapter/Abstract.php(460): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /opt/bitnami/apache2/htdocs/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /opt/bitnami/apache2/htdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Resource.php(179): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#8 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Resource/Cache.php(53): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Cache.php(478): Mage_Core_Model_Resource_Cache->getAllOptions()
#12 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Cache.php(520): Mage_Core_Model_Cache->_initOptions()
#13 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/App.php(1202): Mage_Core_Model_Cache->canUse('config')
#14 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Config.php(414): Mage_Core_Model_App->useCache('config')
#15 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/Config.php(294): Mage_Core_Model_Config->_canUseCacheForInit()
#16 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/App.php(424): Mage_Core_Model_Config->loadModulesCache()
#17 /opt/bitnami/apache2/htdocs/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Model_App->_initModules()
#18 /opt/bitnami/apache2/htdocs/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#19 /opt/bitnami/apache2/htdocs/index.php(83): Mage::run('', 'store')
#20 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";}
一切正常,prod实例指向dev db instance
PROD Bitnami是DEV Bitnami的副本 PROD RDS DB是DEV RDS DB的恢复快照