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

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.

主站蜘蛛池模板: 溆浦县| 伊金霍洛旗| 玛纳斯县| 潢川县| 甘肃省| 延川县| 金华市| 乌拉特中旗| 伊宁市| 朝阳区| 大埔区| 常德市| 漳州市| 元氏县| 于都县| 若羌县| 灵川县| 辽中县| 虹口区| 两当县| 内江市| 汝城县| 二手房| 乌兰县| 江永县| 朝阳区| 信丰县| 深州市| 锡林郭勒盟| 隆林| 富顺县| 石楼县| 福安市| 平度市| 渭南市| 车险| 湘潭县| 天津市| 钟山县| 昭通市| 海门市|