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

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.

主站蜘蛛池模板: 南漳县| 柯坪县| 尚志市| 漯河市| 太原市| 丰台区| 内乡县| 基隆市| 通山县| 红桥区| 即墨市| 湟中县| 察隅县| 卢氏县| 什邡市| 南雄市| 彩票| 木兰县| 香河县| 襄城县| 舞阳县| 汝城县| 屯昌县| 平安县| 沙坪坝区| 铜川市| 阿克陶县| 乌苏市| 吐鲁番市| 瓦房店市| 莆田市| 武汉市| 玉山县| 闽侯县| 山阳县| 彝良县| 儋州市| 甘南县| 苗栗市| 南靖县| 康乐县|