Configuring MySQL

While the embedded Apache Derby database is ideal for tests, in a production development environment it is recommended to switch to an enterprise database.

Creating the database

Sonar comes bundled with an SQL script to create the database and the sonar user with the password sonar. The script is located at @SONAR_HOME/extras/database/mysql/create_database.sql. To execute the script, open up a terminal and execute the following command, (enter your root password or sonar when prompted):

$ mysql -u root -p < create_database.sql

The script creates a new Sonar database with UTF8 encoding and user sonar with password sonar.

Setting up Sonar with MySQL

Having the database up and running, we then must deactivate the embedded Apache Derby ...

Get Sonar Code Quality Testing Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.