0

我在 amazon aws 实例上安装了 icinga-web,当我在浏览器中打开 icinga-web 时,我在黄色框中看到“请求失败”的消息,当我转到控制台并单击该错误时,我得到了这样的堆栈跟踪

PDO Connection Error: SQLSTATE[HY000] [1045] Access denied for user 'icinga'@'localhost' (using password: YES)
Stacktrace:
#0 /usr/local/icinga-web/lib/doctrine/lib/Doctrine/Connection/Mysql.php(101): Doctrine_Connection->connect()
#1 /usr/local/icinga-web/lib/doctrine/lib/Doctrine/Connection.php(1009): Doctrine_Connection_Mysql->connect()
#2 /usr/local/icinga-web/lib/doctrine/lib/Doctrine/Query/Abstract.php(976): Doctrine_Connection->execute('SELECT i.progra...', Array)
#3 /usr/local/icinga-web/app/modules/Api/lib/database/IcingaDoctrine_Query.class.php(116): Doctrine_Query_Abstract->_execute(Array)
#4 /usr/local/icinga-web/lib/doctrine/lib/Doctrine/Query/Abstract.php(1026): IcingaDoctrine_Query->_execute(Array)
#5 /usr/local/icinga-web/app/modules/Cronks/models/Provider/ProgramStatusModel.class.php(103): Doctrine_Query_Abstract->execute()
#6 /usr/local/icinga-web/app/modules/Cronks/models/Provider/ProgramStatusModel.class.php(88): Cronks_Provider_ProgramStatusModel->refresh()
#7 /usr/local/icinga-web/app/cache/config/compile.xml_production__119920113a175a2dcea22e33a36de83ba298e663.php(441): Cronks_Provider_ProgramStatusModel->initialize(Object(AppKitAgaviContext), Array)
#8 /usr/local/icinga-web/app/modules/Cronks/models/Provider/SystemPerformanceModel.class.php(36): AgaviContext->getModel('Provider/Progra...', 'Cronks')
#9 /usr/local/icinga-web/app/cache/config/compile.xml_production__119920113a175a2dcea22e33a36de83ba298e663.php(441): Cronks_Provider_SystemPerformanceModel->initialize(Object(AppKitAgaviContext), Array)
#10 /usr/local/icinga-web/app/modules/Cronks/views/System/MonitorPerformanceSuccessView.class.php(35): AgaviContext->getModel('Provider/System...', 'Cronks')
#11 /usr/local/icinga-web/app/cache/config/compile.xml_production__119920113a175a2dcea22e33a36de83ba298e663.php(1672): Cronks_System_MonitorPerformanceSuccessView->executeJson(Object(AgaviWebRequestDataHolder))
#12 /usr/local/icinga-web/app/cache/config/compile.xml_production__119920113a175a2dcea22e33a36de83ba298e663.php(1533): AgaviExecutionFilter->executeView(Object(AgaviExecutionContainer))
#13 /usr/local/icinga-web/app/cache/config/compile.xml_production__119920113a175a2dcea22e33a36de83ba298e663.php(1255): AgaviExecutionFilter->execute(Object(AgaviFilterChain), Object(AgaviExecutionContainer))
#14 /usr/local/icinga-web/app/cache/config/compile.xml_production__119920113a175a2dcea22e33a36de83ba298e663.php(1700): AgaviFilter->executeOnce(Object(AgaviFilterChain), Object(AgaviExecutionContainer))
#15 /usr/local/icinga-web/lib/agavi/src/filter/AgaviSecurityFilter.class.php(73): AgaviFilterChain->execute(Object(AgaviExecutionContainer))
#16 /usr/local/icinga-web/app/cache/config/compile.xml_production__119920113a175a2dcea22e33a36de83ba298e663.php(1255): AgaviSecurityFilter->execute(Object(AgaviFilterChain), Object(AgaviExecutionContainer))
#17 /usr/local/icinga-web/app/cache/config/compile.xml_production__119920113a175a2dcea22e33a36de83ba298e663.php(1700): AgaviFilter->executeOnce(Object(AgaviFilterChain), Object(AgaviExecutionContainer))
#18 /usr/local/icinga-web/app/cache/config/compile.xml_production__119920113a175a2dcea22e33a36de83ba298e663.php(870): AgaviFilterChain->execute(Object(AgaviExecutionContainer))
#19 /usr/local/icinga-web/app/cache/config/compile.xml_production__119920113a175a2dcea22e33a36de83ba298e663.php(1266): AgaviExecutionContainer->execute()
#20 /usr/local/icinga-web/app/cache/config/compile.xml_production__119920113a175a2dcea22e33a36de83ba298e663.php(1255): AgaviDispatchFilter->execute(Object(AgaviFilterChain), Object(AgaviExecutionContainer))
#21 /usr/local/icinga-web/app/cache/config/compile.xml_production__119920113a175a2dcea22e33a36de83ba298e663.php(1700): AgaviFilter->executeOnce(Object(AgaviFilterChain), Object(AgaviExecutionContainer))
#22 /usr/local/icinga-web/lib/agavi/src/filter/AgaviFormPopulationFilter.class.php(78): AgaviFilterChain->execute(Object(AgaviExecutionContainer))
#23 /usr/local/icinga-web/app/cache/config/compile.xml_production__119920113a175a2dcea22e33a36de83ba298e663.php(1700): AgaviFormPopulationFilter->executeOnce(Object(AgaviFilterChain), Object(AgaviExecutionContainer))
#24 /usr/local/icinga-web/app/cache/config/compile.xml_production__119920113a175a2dcea22e33a36de83ba298e663.php(579): AgaviFilterChain->execute(Object(AgaviExecutionContainer))
#25 /usr/local/icinga-web/pub/index.php(49): AgaviController->dispatch()
#26 {main}

我应该怎么做才能解决这个问题?

谢谢

4

2 回答 2

1

您的 MySQL 凭据在 Icinga 中是错误的。您可以检查它们,甚至可以在配置 -> 应用程序 -> 资源下测试连接。

IcingaWeb2 资源

也可能是您的数据库没有 Icinga 用户或访问权限。在 MySQL 中做一个SHOW GRANTS检查。

于 2017-07-10T20:13:58.663 回答
0

您需要在 MySQL 中为 icinga 用户添加权限:

GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga.* TO 'icinga'@'localhost' IDENTIFIED BY 'icinga';
FLUSH PRIVILEGES;
于 2021-10-18T14:48:19.743 回答