我已经在我的localhost上创建了一个我现场Magento商店的副本并使用了相同的db文件,但它显示了以下错误消息:
处理您的请求时出错。异常打印是 出于安全原因,默认情况下禁用。
请有人告诉我原因。请帮我解决这个问题。提前感谢您的时间和帮助。
错误日志记录编号:350810859
1. a:4:{i:0;s:93:"SQLSTATE[HY000] [1045] Access denied for user
'root'@'localhost' (using password: YES)";i:1;s:2492:"#0
D:\workspace_php\abc_store\lib\Zend\Db\Adapter\Pdo\Mysql.php(96):
Zend_Db_Adapter_Pdo_Abstract->_connect()
D:\workspace_php\abc_store\lib\Varien\Db\Adapter\Pdo\Mysql.php(313):
Zend_Db_Adapter_Pdo_Mysql->_connect()
D:\workspace_php\abc_store\lib\Zend\Db\Adapter\Abstract.php(459):
Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 D:\workspace_php\abc_store\lib\Zend\Db\Adapter\Pdo\Abstract.php(238):
Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 D:\workspace_php\abc_store\lib\Varien\Db\Adapter\Pdo\Mysql.php(419):
Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 D:\workspace_php\abc_store\app\code\core\Mage\Core\Model\Resource.php(169):
Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 D:\workspace_php\abc_store\app\code\core\Mage\Core\Model\Resource.php(110):
Mage_Core_Model_Resource->_newConnection('pdo_mysql',
Object(Mage_Core_Model_Config_Element))
#7 D:\workspace_php\abc_store\app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(320):
Mage_Core_Model_Resource->getConnection('core_write')
#8 D:\workspace_php\abc_store\app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(350):
Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9 D:\workspace_php\abc_store\app\code\core\Mage\Core\Model\Resource\Db\Abstract.php(335):
Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10 D:\workspace_php\abc_store\app\code\core\Mage\Core\Model\Resource\Cache.php(53): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11 D:\workspace_php\abc_store\app\code\core\Mage\Core\Model\Cache.php(455):
Mage_Core_Model_Resource_Cache->getAllOptions()
#12 D:\workspace_php\abc_store\app\code\core\Mage\Core\Model\Cache.php(497):
Mage_Core_Model_Cache->_initOptions()
#13 D:\workspace_php\abc_store\app\code\core\Mage\Core\Model\App.php(1183):
Mage_Core_Model_Cache->canUse('config')
#14 D:\workspace_php\abc_store\app\code\core\Mage\Core\Model\Config.php(414):
Mage_Core_Model_App->useCache('config')
#15 D:\workspace_php\abc_store\app\code\core\Mage\Core\Model\Config.php(294):
Mage_Core_Model_Config->_canUseCacheForInit()
#16 D:\workspace_php\abc_store\app\code\core\Mage\Core\Model\App.php(413):
Mage_Core_Model_Config->loadModulesCache()
#17 D:\workspace_php\abc_store\app\code\core\Mage\Core\Model\App.php(343):
Mage_Core_Model_App->_initModules()
#18 D:\workspace_php\abc_store\app\Mage.php(683): Mage_Core_Model_App->run(Array)
#19 D:\workspace_php\abc_store\index.php(87): Mage::run('', 'store')
#20 {main}";s:3:"url";s:12:"/abc_store/";s:11:"script_name";s:21:"/abc_store/index.php";}
答案 0 :(得分:2)
这似乎是数据库连接错误。您可以使用以下凭据作为示例,并根据 app / etc / local.xml 文件中的数据库详细信息更改它们
<host><![CDATA[localhost]]></host>
<username><![CDATA[root]]></username>
<password><![CDATA[your_password_if_any]]></password>
<dbname><![CDATA[your_db_name]]></dbname>
同样在你的core_config_data表中更改值如下
web/unsecure/base_url - http://YOUR_IP_ADDRESS/YOUR_PROJECT_NAME/
web/secure/base_url - http://YOUR_IP_ADDRESS/YOUR_PROJECT_NAME/
答案 1 :(得分:2)
我认为这里的问题与数据库凭据有关。查看以下文件
app/etc/local.xml
答案 2 :(得分:0)
您必须制作虚拟主机才能运行live magento并在文件windows / system32 / drivers / etchosts文件中进行更改。
您必须将localhost IP地址映射到域名。