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

标签 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

最佳答案

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

关于database - SQLSTATE[28000] [1045] 拒绝用户 'xx' @'example.com' 的访问(使用密码 : YES),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17482834/

相关文章:

php - mySQL 给出不正确的结果

php - 未捕获的类型错误:传递给 Mage_Core_Model_Store_Group::setWebsite() 的参数 1 必须是 Mage_Core_Model_Website 的实例,给定 null

php - 使用 SQL 查询获取所有 Magento 类别

php - Magento 中的菜单/导航栏

mysql - Magento 按浏览量对类别中的产品进行排序

java - 如何增加从java数据库中获取特定值的时间?

python - 在各种游标/连接上使用 BEGIN TRANSACTION/ROLLBACK/COMMIT

database - 在不复制输出的情况下从多个表创建 View

jquery - AJAX - 购物车 Magento 总计和购物车中的商品

magento-1.7 - magento自定义模块上传多个图像