Magento Down SQLSTATE[28000] Error – How to Fix Access Denied for User

magento-1.9

This has happened before and it seemed to be the maintenance.flag file staying so I would have to rename it "maintenance.flag_", I fixed this by not allowing it to put the site into maintenance mode while doing backups.

New issue popped up this morning with the Error code "933412900636" and the contents listed below;

a:4:{i:0;s:98:"SQLSTATE[28000] [1045] Access denied for user 'pctekcom_magento'@'127.0.0.1' (using password: YES)";i:1;s:2994:"
#0 /home/pctekcom/public_html/lib/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /home/pctekcom/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(396): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /home/pctekcom/public_html/lib/Zend/Db/Adapter/Abstract.php(460): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /home/pctekcom/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /home/pctekcom/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /home/pctekcom/public_html/app/code/core/Mage/Core/Model/Resource.php(179): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /home/pctekcom/public_html/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 /home/pctekcom/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#8 /home/pctekcom/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9 /home/pctekcom/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10 /home/pctekcom/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(360): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11 /home/pctekcom/public_html/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Mage_Core_Model_Resource_Db_Abstract->getReadConnection()
#12 /home/pctekcom/public_html/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/pctekcom/public_html/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/pctekcom/public_html/app/Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#15 /home/pctekcom/public_html/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#16 /home/pctekcom/public_html/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
#17 /home/pctekcom/public_html/app/code/core/Mage/Core/Model/App.php(608): Mage_Core_Model_Abstract->getCollection()
#18 /home/pctekcom/public_html/app/code/core/Mage/Core/Model/App.php(466): Mage_Core_Model_App->_initStores()
#19 /home/pctekcom/public_html/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Model_App->_initCurrentStore('', 'store')
#20 /home/pctekcom/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#21 /home/pctekcom/public_html/index.php(87): Mage::run('', 'store')
#22 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";}

There is now a new error popping up after deleting the maintenance.flag files.

Fatal error: require_once(): Failed opening required '/home/pctekcom/public_html/errors/report.php' (include_path='/home/pctekcom/public_html/app/code/local:/home/pctekcom/public_html/app/code/community:/home/pctekcom/public_html/app/code/core:/home/pctekcom/public_html/lib:.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in /home/pctekcom/public_html/app/Mage.php on line 925

There is no file called report.php in the directory /errors/

Best Answer

Wrong username and password or invalid access rights to you MySQL server.

Check app/etc/local.xml and verify your credentials.

If you need to reset you MySQL password you have to access your MySQL shell and use the following command (replace with correct information):

GRANT ALL PRIVILEGES ON yourdbname.* TO 'pctekcom_magento'@'127.0.0.1' IDENTIFIED BY 'yourpassword';

NOTE: MySQL username and password, NOT Magento username and password.

If you have phpMyAdmin you can use the "users" function.

Also try using localhost instead of 127.0.0.1 in your app/etc/local.xml, sometimes it fails the reverse lookup for localhost.

Related Topic