我使用以下軟件:聲納無法連接到數據庫
- 聲納3.4.1
- MySQL 5.1中
- 的Maven 2.2.1
- 的Tomcat 7
我有一個pom.xml文件,我試圖用Sonar執行,但得到follwing錯誤。
[INFO] Building asgard-bpm
[INFO] task-segment: [sonar:sonar] (aggregator-style)
[INFO] -----------------------------------------------------------------------
[INFO] [sonar:sonar {execution: default-cli}]
[INFO] Sonar host: http://{host:8080}/sonar
[INFO] Sonar version: 3.4.1
[INFO] Execute: org.codehaus.sonar:sonar-maven-plugin:3.4.1:sonar
[INFO] [sonar:sonar {execution: default-sonar}]
[INFO] [14:34:54.474] Load project settings
[INFO] [14:34:54.552] Install plugins
[INFO] [14:34:56.674] Apply project exclusions
[INFO] [14:34:56.674] Install JDBC driver
[WARN] [14:34:56.736] H2 database should be used for evaluation purpose only
[INFO] [14:34:56.736] Create JDBC datasource for jdbc:h2:tcp://host/sonar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can not execute Sonar
Embedded error: Fail to connect to database
Connection refused: connect
我已經創建了一個數據庫中的用戶與用戶名爲「聲納」,密碼爲「sonarsonar」。
創建了名爲'sonar'的模式並且還授予了所有特權。
下面是在SONAR.properties文件中設置的屬性。
sonar.web.host: {127.0.0.1}
sonar.web.port: 80
sonar.web.context: /
sonar.jdbc.username: sonar
sonar.jdbc.password: sonarsonar
sonar.jdbc.url: {jdbc:mysql://host:3306/sonaruseUnicode=true&characterEncoding=utf8}
sonar.jdbc.driverClassName: com.mysql.jdbc.Driver
sonar.jdbc.validationQuery: select 1
有人可以告訴我如何解決這個錯誤。
看起來你的聲納服務器已配置到好好的談一次到MySQL,但您的構建仍然談話的默認數據庫H2。 –
我有同樣的問題 – BigDong