Access denied for user - recently changed password - details in local.xml correct
سؤال
I recently changed the password for the admin user in MySQL. I updated the /app/etc/local.xml file to:
<connection>
<host><![CDATA[<serverAddress>]]></host>
<username><![CDATA[<username>]]></username>
<password><![CDATA[<password>]]></password>
<dbname><![CDATA[<dbName>]]></dbname>
<initStatements><![CDATA[SET NAMES utf8]]></initStatements>
<model><![CDATA[mysql4]]></model>
<type><![CDATA[pdo_mysql]]></type>
<pdoType><![CDATA[]]></pdoType>
<active>1</active>
</connection>
When connecting to the home page it displays an error and the log number. Opening the log number I see:
a:4:{i:0;s:104:"SQLSTATE[HY000] [1045] Access denied for user 'username'@'ps251818.dreamhost.com' (using password: YES)";i:1;s:3125:"#0 /home/<username>/<homePage>/lib/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /home/<username>/<homePage>/lib/Varien/Db/Adapter/Pdo/Mysql.php(313): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /home/<username>/<homePage>/lib/Zend/Db/Adapter/Abstract.php(459): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /home/<username>/<homePage>/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /home/<username>/<homePage>/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /home/<username>/<homePage>/app/code/core/Mage/Core/Model/Resource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /home/<username>/<homePage>/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 /home/<username>/<homePage>/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#8 /home/<username>/<homePage>/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9 /home/<username>/<homePage>/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10 /home/<username>/<homePage>/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(360): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11 /home/<username>/<homePage>/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Mage_Core_Model_Resource_Db_Abstract->getReadConnection()
#12 /home/<username>/<homePage>/app/code/core/Mage/Core/Model/Config.php(1348): Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Object(Mage_Core_Model_Resource_Website))
#13 /home/<username>/<homePage>/app/code/core/Mage/Core/Model/Config.php(1380): Mage_Core_Model_Config->getModelInstance('core_resource/w...', Object(Mage_Core_Model_Resource_Website))
#14 /home/<username>/<homePage>/app/Mage.php(490): Mage_Core_Model_Config->getResourceModelInstance('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#15 /home/<username>/<homePage>/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#16 /home/<username>/<homePage>/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
#17 /home/<username>/<homePage>/app/code/core/Mage/Core/Model/App.php(608): Mage_Core_Model_Abstract->getCollection()
#18 /home/<username>/<homePage>/app/code/core/Mage/Core/Model/App.php(466): Mage_Core_Model_App->_initStores()
#19 /home/<username>/<homePage>/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Model_App->_initCurrentStore('', 'store')
#20 /home/<username>/<homePage>/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#21 /home/<username>/<homePage>/index.php(91): Mage::run('', 'store')
#22 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";}
I have checked phpMyAdmin, and MySQL Workbench, the credentials provided are correct. Does it take time to propagate through from local.xml for the details to be used? The password has "@" in it, would this cause an issue? Example, in the local.xml file it looks something like:
<password><![CDATA[@bcDefghi1]]></password>
I don't know if this would cause an issue, but everything seems fine and I am clutching at straws.
المحلول
You issue may in magento cache and Magento have cache ur database connection in cache. So need to flush magento cache by below process:
If you have magento cache store type file then you need to log ur magento Application Dir and then goes to it var/cache folder and delete all files from this folder
If you have using memcache or redis as cache store then you need to flush those cache
by command line