0

I get this error on my frontend: An error has happened during application run. See exception log for details.

This is my exceptions.log:

2017-10-16 14:21:13] main.CRITICAL: exception 'PDOException' with message 'SQLSTATE[HY000] [1045] Access denied for user 'myusername'@xxx.Xxx.xxx.xxx' (using password: YES)' in /var/sites/v/domainm2.co.uk/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php:129
Stack trace:
#0 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(129): PDO->__construct('mysql:host=10.1...', 'myusername', 'password...', Array)
#1 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
#2 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(353): Zend_Db_Adapter_Pdo_Mysql->_connect()
#3 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(460): Magento\Framework\DB\Adapter\Pdo\Mysql->_connect()
#4 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
#5 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(465): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
#6 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(520): Magento\Framework\DB\Adapter\Pdo\Mysql->_query(Object(Magento\Framework\DB\Select), Array)
#7 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(737): Magento\Framework\DB\Adapter\Pdo\Mysql->query(Object(Magento\Framework\DB\Select), Array)
#8 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/Data/Collection/Db/FetchStrategy/Query.php(21): Zend_Db_Adapter_Abstract->fetchAll(Object(Magento\Framework\DB\Select), Array)
#9 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/Data/Collection/AbstractDb.php(772): Magento\Framework\Data\Collection\Db\FetchStrategy\Query->fetchAll(Object(Magento\Framework\DB\Select), Array)
#10 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/Data/Collection/AbstractDb.php(668): Magento\Framework\Data\Collection\AbstractDb->_fetchAll(Object(Magento\Framework\DB\Select))
#11 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/Data/Collection/AbstractDb.php(572): Magento\Framework\Data\Collection\AbstractDb->getData()
#12 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/Data/Collection/AbstractDb.php(557): Magento\Framework\Data\Collection\AbstractDb->loadWithFilter(false, false)
#13 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/Data/Collection.php(820): Magento\Framework\Data\Collection\AbstractDb->load()
#14 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/module-config/App/Config/Source/RuntimeConfigSource.php(78): Magento\Framework\Data\Collection->getIterator()
#15 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/module-config/App/Config/Source/RuntimeConfigSource.php(58): Magento\Config\App\Config\Source\RuntimeConfigSource->loadConfig()
#16 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/App/Config/ConfigSourceAggregated.php(40): Magento\Config\App\Config\Source\RuntimeConfigSource->get('')
#17 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/module-config/App/Config/Type/System/Reader.php(73): Magento\Framework\App\Config\ConfigSourceAggregated->get()
#18 /var/sites/v/domainm2.co.uk/public_html/var/generation/Magento/Config/App/Config/Type/System/Reader/Proxy.php(95): Magento\Config\App\Config\Type\System\Reader->read()
#19 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/module-config/App/Config/Type/System.php(212): Magento\Config\App\Config\Type\System\Reader\Proxy->read()
#20 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/module-config/App/Config/Type/System.php(170): Magento\Config\App\Config\Type\System->loadDefaultScopeData('default')
#21 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/App/Config.php(139): Magento\Config\App\Config\Type\System->get('default/web/sec...')
#22 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/App/Config.php(90): Magento\Framework\App\Config->get('system', 'default/web/sec...')
#23 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/App/Config.php(103): Magento\Framework\App\Config->getValue('web/secure/use_...', 'default', NULL)
#24 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/module-store/Model/HeaderProvider/Hsts.php(48): Magento\Framework\App\Config->isSetFlag('web/secure/use_...')
#25 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/App/Response/HeaderManager.php(41): Magento\Store\Model\HeaderProvider\Hsts->canApply()
#26 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/Interception/Interceptor.php(123): Magento\Framework\App\Response\HeaderManager->beforeSendResponse(Object(Magento\Framework\App\Response\Http\Interceptor))
#27 /var/sites/v/domainm2.co.uk/public_html/var/generation/Magento/Framework/App/Response/Http/Interceptor.php(117): Magento\Framework\App\Response\Http\Interceptor->___callPlugins('sendResponse', Array, Array)
#28 /var/sites/v/domainm2.co.uk/public_html/pub/errors/report.php(15): Magento\Framework\App\Response\Http\Interceptor->sendResponse()
#29 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/App/Http.php(323): require('/var/sites/v/va...')
#30 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/App/Http.php(160): Magento\Framework\App\Http->handleGenericReport(Object(Magento\Framework\App\Bootstrap), Object(Zend_Db_Adapter_Exception))
#31 /var/sites/v/domainm2.co.uk/public_html/vendor/magento/framework/App/Bootstrap.php(263): Magento\Framework\App\Http->catchException(Object(Magento\Framework\App\Bootstrap), Object(Zend_Db_Adapter_Exception))
#32 /var/sites/v/domainm2.co.uk/public_html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#33 {main}

Anyone could help me?

1
  1. Your MySQL connection is failing with "Access denied". This means your MySQL user hasn't been granted permission to the database you are telling it to use.

Try the recommendations here for others with the same problem: https://stackoverflow.com/questions/20353402/access-denied-for-user-testlocalhost-using-password-yes-except-root-user

Try the official MySQL troubleshooting guide on connection problems: https://dev.mysql.com/doc/refman/5.7/en/problems-connecting.html

  1. Your MySQL username and password (part of it, anyway) are in your question. Change them.
1
  • That worked. Yes, didn't realise there was sensitive information there. I have deleted the user now. Thank you.
    – Greg
    Oct 23 '17 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.