SQLSTATE [28000] [1045]用户'xx'@'example.com'拒绝访问(使用密码:是)

时间:2013-07-05 06:55:38

标签: database magento magento-1.7

出于安全原因我更改了我的数据库密码时出现此错误。我还更新了我的/app/etc/local.xml

There has been an error processing your request

SQLSTATE[28000] [1045] Access denied for user  'xx'@'example.com' (using password: YES)

Trace:
#0 /var/www/vhosts/example.com/xxx/lib/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /var/www/vhosts/example.com/xxx/lib/Varien/Db/Adapter/Pdo/Mysql.php(313): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /var/www/vhosts/example.com/xxx/lib/Zend/Db/Adapter/Abstract.php(459): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /var/www/vhosts/example.com/xxx/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /var/www/vhosts/example.com/xxx/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /var/www/vhosts/example.com/xxx/app/code/core/Mage/Core/Model/Resource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /var/www/vhosts/example.com/xxx/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 /var/www/vhosts/example.com/xxx/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#8 /var/www/vhosts/example.com/xxx/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9 /var/www/vhosts/example.com/xxx/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10 /var/www/vhosts/example.com/xxx/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(360): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11 /var/www/vhosts/example.com/xxx/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Mage_Core_Model_Resource_Db_Abstract->getReadConnection()
#12 /var/www/vhosts/example.com/xxx/app/code/core/Mage/Core/Model/Config.php(1348): Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Object(Mage_Core_Model_Resource_Website))
#13 /var/www/vhosts/example.com/xxx/app/code/core/Mage/Core/Model/Config.php(1380): Mage_Core_Model_Config->getModelInstance('core_resource/w...', Object(Mage_Core_Model_Resource_Website))
#14 /var/www/vhosts/example.com/xxx/app/Mage.php(490): Mage_Core_Model_Config->getResourceModelInstance('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#15 /var/www/vhosts/example.com/xxx/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#16 /var/www/vhosts/example.com/xxx/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
#17 /var/www/vhosts/example.com/xxx/app/code/core/Mage/Core/Model/App.php(608): Mage_Core_Model_Abstract->getCollection()
#18 /var/www/vhosts/example.com/xxx/app/code/core/Mage/Core/Model/App.php(466): Mage_Core_Model_App->_initStores()
#19 /var/www/vhosts/example.com/xxx/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Model_App->_initCurrentStore('', 'store')
#20 /var/www/vhosts/example.com/xxx/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#21 /var/www/vhosts/example.com/xxx/index.php(87): Mage::run(NULL, 'store')
#22 {main}

我可以使用SQLyog远程服务器访问我的数据库,但是当我访问我的网站时出现错误。

我也尝试这样做,但我又犯了一个错误。

GRANT ALL PRIVILEGES ON *.* TO  'xx'@'example.com' IDENTIFIED BY '1234' WITH GRANT OPTION;
FLUSH PRIVILEGES;

--------------------------------------------------------------------------------------
Query : GRANT ALL PRIVILEGES ON *.* TO 'xx'@'example.com' IDENTIFIED BY '1234' WITH GRANT OPTION

Error Code : 1045
Access denied for user 'xxx'@'%' (using password: YES)

Execution Time : 00:00:00:000
Transfer Time  : 00:00:00:000
Total Time     : 00:00:00:000

1 个答案:

答案 0 :(得分:5)

尝试清除缓存。数据库凭据已缓存。如果您在magento安装中使用文件缓存删除var/cache文件夹。