Edit online

How to Set Up the Database for Oxygen Feedback Service

Supported databases:
  • MySQL 8.0
  • PostgreSQL 11
  • PostgreSQL 12

MySQL

To connect Oxygen Feedback Enterprise to the MySQL database, follow these steps:
  1. Create a database user that will be used by Oxygen Feedback Enterprise to connect to the database. For example, feedback_db_user:
    CREATE USER 'feedback_db_user'@'localhost' IDENTIFIED BY 'password';

    This creates a user that can connect from the localhost. For more details, see: https://dev.mysql.com/doc/refman/8.0/en/create-user.html.

  2. Create the database where Oxygen Feedback Enterprise will store its data. For example, feedback_db:
    CREATE DATABASE feedback_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

    The database must have a character set of UTF8. For more details, see: https://dev.mysql.com/doc/refman/8.0/en/create-database.html.

  3. The user needs to have permission to connect to the database, create and populate the tables, etc. You can provide these permissions with the following command:
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, 
    CREATE VIEW, EVENT, TRIGGER, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EXECUTE ON feedback_db.* 
    TO 'feedback_db_user'@'localhost';
    flush privileges;

    For more details, see: https://dev.mysql.com/doc/refman/8.0/en/grant.html.

  4. Copy the MySQL JDBC driver:
    1. Go to https://dev.mysql.com/downloads/connector/j/8.0.html.
    2. For Select Operating System, chooses Platform Independent.
    3. Download the connector.
    4. Extract the contents from the downloaded MySQL connector JAR file to the installation directory. For example:
      $OXYGEN_FEEDBACK_INSTALL_DIR/oxygen-feedback-1.3/lib 
      Note:
      Only the MySQL connector JAR file should be copied to the directory mentioned above, and not the entire archive content.
  5. Configure Oxygen Feedback Enterprise to connect to the database:
    1. Go to /config and create a file named feedback-database.properties.
    2. Edit the file and update it with your configuration. An example is provided in the feedback-database-mysql.properties file. It should look like this:
      # The database management system type. For example MySQL or PostgreSQL.
      feedback.database.type = mysql
      # The database URL in format: jdbc:mysql://<hostname>:<port>/<database>
      feedback.datasource.url=jdbc:mysql://db_server_host:3306/feedback_db
      # The username to access the database
      feedback.datasource.username=feedback_db_user
      # The password to access the database
      feedback.datasource.password=password

      In this example, replace db_server_host with the actual IP address or hostname of the machine running the MySQL server (it can also be an internal network name if both services run on the same Docker network).

      Important:

      Since Oxygen Feedback Enterprise always runs inside a Docker container, do not use localhost in the database server URL configuration.

      Inside the container, localhost refers to the container itself, not the host machine. To connect to a MySQL database running on the host machine or another server, use the host machine's IP address instead of localhost. You can determine the host's IP by running ip a on the host machine.

      If the database is hosted on the same machine, ensure it is configured to accept connections from external sources (e.g. Docker containers).

PostgreSQL

To connect Oxygen Feedback Enterprise to the PostgreSQL database, follow these steps:
  1. Create a database user that will be used by Oxygen Feedback Enterprise to connect to the database. For example, feedback_db_user:
    CREATE USER feedback_db_user WITH PASSWORD 'password';

    For more details, see: https://www.postgresql.org/docs/12/sql-createuser.html.

  2. Create the database where Oxygen Feedback Enterprise will store its data. For example, feedback_db:
    CREATE DATABASE feedback_db ENCODING='UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE='template0';

    The database must have the encoding set of UTF8. For more details, see: https://www.postgresql.org/docs/12/sql-createdatabase.html.

  3. The user needs to have permission to connect to the database, create and populate the tables, etc. You can provide these permissions with the following command:
    GRANT ALL PRIVILEGES ON DATABASE feedback_db TO feedback_db_user;

    For more details, see: https://www.postgresql.org/docs/12/sql-grant.html.

  4. Configure Oxygen Feedback Enterprise to connect to the database:
    1. Go to /config and create a file named feedback-database.properties.
    2. Edit the file and update it with your configuration. An example is provided in the feedback-database-psql.properties file. It should look like this:
      # The database management system type. For example MySQL or PostgreSQL.
      feedback.database.type = postgresql
      # The database URL in format: jdbc:postgresql://<hostname>:<port>/<database>
      feedback.datasource.url=jdbc:postgresql://db_server_host:5432/feedback_db
      # The username to access the database
      feedback.datasource.username=feedback_db_user
      # The password to access the database
      feedback.datasource.password=password
      In this example, replace db_server_host with the actual IP address or hostname of the machine running the PostgreSQL server (it can also be an internal network name if both services run on the same Docker network).
      Important:

      Since Oxygen Feedback Enterprise always runs inside a Docker container, do not use localhost in the database server URL configuration.

      Inside the container, localhost refers to the container itself, not the host machine. To connect to a MySQL database running on the host machine or another server, use the host machine's IP address instead of localhost. You can determine the host's IP by running ip a on the host machine.

      If the database is hosted on the same machine, ensure it is configured to accept connections from external sources (e.g. Docker containers).