官术网_书友最值得收藏!

Configuring PostgreSQL

The first thing we need to do is create a user and database that SonarQube can use. Just for the record, SonarQube can work with SQL Server, MySQL, and Oracle too, but PostgreSQL is always a good (and free) choice.

On Ubuntu, open the PostgreSQL terminal and run the script to create a sonar user and then the script to create a database, making the sonar user the owner:

sudo -u postgres psql
\create user sonar with password 'sonar';
\create database sonar with owner sonar encoding 'UTF8';
\q

The UTF8 encoding is NOT optional, so be sure to include it. Also, don't forget the semicolons at the end of your statements.

On Windows, you can also create a user and database using the command prompt. It only differs from Ubuntu in the first line:

cd "C:\Program Files\PostgreSQL\9.5\bin\psql" -U postgres
[enter password]
\create user sonar with password 'sonar';
\create database sonar with owner sonar encoding 'UTF8';
\q

If you installed PostgreSQL in another folder, you should change that in the command. You may, of course, also create a user and database using pgAdmin. Just right-click on the Login/Group Roles node and create. Same for the new database.

主站蜘蛛池模板: 乡城县| 昭平县| 东乡县| 文成县| 内丘县| 鄂尔多斯市| 南充市| 贡嘎县| 东明县| 凌海市| 桦川县| 云林县| 紫金县| 甘泉县| 连江县| 宣化县| 万州区| 读书| 醴陵市| 永康市| 武乡县| 泰和县| 玉田县| 南平市| 伊川县| 历史| 永春县| 吉首市| 班玛县| 信丰县| 肥东县| 仁寿县| 清新县| 吉水县| 栖霞市| 南开区| 通榆县| 全州县| 瑞昌市| 永和县| 东乌|