mysql adds a database named sonar and the user sonarqube@sonarqube
Unzip SonarQube and modify the database configuration and user configuration of the configuration file
[root@localhost pig]# vim sonarqube-6.4/conf/sonar.properties
# Configure database user name and password
sonar.jdbc.username=sonarqube
sonar.jdbc.password=sonarqube
# Open the comment on the following line
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false
sonar.web.port=9000
Visit http://ip:9000 after starting SonarQube
[root@localhost pig]# cd sonarqube-6.4/bin/linux-x86-64/
[root@localhost linux-x86-64]# ./sonar.sh start
Install Chinese plug-ins, etc
Search for the chinese Pack plug-in in the administrator area, install and restart it
SonarQube Scanner profile
# vim sonar-scanner/conf/sonar-scanner.properties
#Configure here general information about the environment, such as SonarQube DB details for example
#No information about specific project should appear here
#----- Default SonarQube server
sonar.host.url=http://localhost:9000
#----- Default source code encoding
sonar.sourceEncoding=UTF-8
sonar.login=admin
sonar.password=admin
sonar.scm.disabled=true
sonar-project.properties
I won't write this
Execute sonar scanner
If there is not enough memory during execution, modify the following configuration
vim /usr/local/sonarqube/sonar-scanner/bin/sonar-scanner
exec "$java_cmd" \
-Djava.awt.headless=true \
$SONAR_SCANNER_OPTS \
$SONAR_SCANNER_DEBUG_OPTS \
-classpath "$jar_file" \
-Dscanner.home="$sonar_scanner_home" \
-Dproject.home="$project_home" \
-Xms256m \
-Xmx1024m \
org.sonarsource.scanner.cli.Main "$@"
Problem summary
- Failed to upload report - 500: An error has occurred
This is a configuration problem for mysql
mysql configuration needs to be modified
[mysqld]
max_allowed_packet = 32M