首先到官网下载最新版https://www.sonarqube.org/downloads/
可以找到连接之后使用wget url 方式下载
依赖项:mysql5.7,jdk8
创建sonar数据库 并新建用户
mysql> CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> CREATE USER ‘sonar’ IDENTIFIED BY ‘sonar’;
mysql> GRANT ALL ON sonar. TO ‘sonar’@’%’ IDENTIFIED BY ‘sonar’;
mysql> GRANT ALL ON sonar. TO ‘sonar’@’localhost’ IDENTIFIED BY ‘sonar’;
mysql> FLUSH PRIVILEGES;
修改/conf/sonar.properties
数据库连接的用户名、密码、url等