How to Set Up the Database for Oxygen Feedback Service
- MySQL 8.0
- PostgreSQL 11
- PostgreSQL 12
MySQL
- 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.
- 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.
- 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.
- Copy the MySQL JDBC driver:
- Go to https://dev.mysql.com/downloads/connector/j/8.0.html.
- For Select Operating System, chooses Platform Independent.
- Download the connector.
- 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.
- Configure Oxygen Feedback Enterprise to connect to the database:
- Go to
/config
and create a file named feedback-database.properties. - 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 oflocalhost
. You can determine the host's IP by runningip 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).
- Go to
PostgreSQL
- 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.
- 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.
- 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.
- Configure Oxygen Feedback Enterprise to connect to the database:
- Go to
/config
and create a file named feedback-database.properties. - 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, replacedb_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 oflocalhost
. You can determine the host's IP by runningip 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).
- Go to