Preparing the MySQL Database for Installation
codeBeamer is delivered with a Derby
database that should be used only for evaluation purposes. It is strongly recommend using codeBeamer with MySQL or Oracle because they are faster and more robust and reliable databases. After Q3 2020,codebeamer does not support the Derby
database.
This page describes how to setup a MySQL database for codeBeamer. Currently MySQL 5.7.x is supported and InnoDB storage engine is required. After Q3 2020, MySQL 8.0.x is also supported.To use this document you should be familiar with MySQL database setup and administration.
IMPORTANT: Backup your data! Before doing anything, backup your existing database. Also ensure that during migration nobody uses the database, because it may cause loss of data.
In case you want to migrate from utf8 schema to utf8mb4 schema please check the You must login to see this link. Register now, if you have no user account yet. page
Windows, Unix, MAC-OS
Downloading and installing the MySQL database is not part of this document. Please refer to the MySQL homepage
for instructions.
Linux
Install MySQL via your distribution's package manager.
We highly recommend to use the same version that codeBeamer was tested on. You can find this version in the release notes of the current version.
MySQL Configuration
Important note: when upgrading codebeamer from an earlier ( pre 10 ) release, please keep the existing encoding and collation ( utf8 ) and perform the utf8mb4 database upgrade AFTER the 10.1 codebeamer upgrade has been completed. Then continue the upgrade to Carmen ( or later release ) so the mysql database procedures and functions will be updated as well.
When installing MySQL, be sure to set and remember a sensible root password.
Please ensure that the following settings are configured in your database. You can find these settings in my.ini, that typically resides in the MySQL installation directory (e.g. in Windows: C:\Program Files\MySQL\MySQL Server 5.7, or Linux/Unix: /etc/mysql/my.cnf, or MAC-OS: /usr/local/mysql/my.cnf).
MySQL 5.x:
[mysqld]
character_set_server=utf8mb4
character_set_filesystem=utf8mb4
collation-server=utf8mb4_general_ci
skip-character-set-client-handshake
max_allowed_packet=128M
sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION'
MySQL 8.0.x:
[mysqld]
character_set_server=utf8mb4
character_set_filesystem=utf8mb4
collation-server=utf8mb4_0900_ai_ci
skip-character-set-client-handshake
max_allowed_packet=128M
sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION'
disable_log_bin
Creating the database
The following steps are not required for new installations, because the database is created automatically by the installer. These steps are only necessary when upgrading or migrating codeBeamer, or when the database is created manually for any other reason.
In the following examples, it is assumed that the database is running on the same machine as codeBeamer (localhost) and listens to default port 3306, but this is not required.
Prepare the codebeamer MySQL database
In order for codeBeamer to access a MySQL database, an appropriate database schema and user have to be prepared. You can use any username and password instead of the cbroot and cbpassword used below:
- Open a command prompt (on Windows execute "cmd"), and go into your $MYSQL_HOME$/bin directory (for example in Windows it could be C:\Program Files\MySQL\MySQL Server 5.7\bin).
- Execute the command: mysql -u root -p. When asked provide it with the password which was configured during installation.
- Execute commands:
MySQL 5.x:
CREATE DATABASE codebeamer default character set 'utf8mb4' default collate 'utf8mb4_general_ci';
CREATE USER 'cbroot'@'localhost' IDENTIFIED BY 'cbpassword';
GRANT ALL PRIVILEGES ON codebeamer.* TO 'cbroot'@'localhost';
FLUSH PRIVILEGES;
MySQL 8.0.x:
CREATE DATABASE codebeamer default character set 'utf8mb4' default collate 'utf8mb4_0900_ai_ci';
CREATE USER 'cbroot'@'localhost' IDENTIFIED BY 'cbpassword';
GRANT ALL PRIVILEGES ON codebeamer.* TO 'cbroot'@'localhost';
FLUSH PRIVILEGES;
Edit/create the configuration file: <cb-installation-dir>/config/configuration.properties
database.driver=com.mysql.jdbc.Driver
database.connectionURL=jdbc:mysql://localhost:3306/codebeamer?autoReconnect=true&zeroDateTimeBehavior=convertToNull&emulateLocators=true&characterEncoding=UTF-8&useSSL=false
database.username=user
database.password=pass
database.passwordStorageType=ENCRYPTED
Start codeBeamer
Please note that after switching to a new database, the initial codeBeamer server start will take longer than usual, because codeBeamer will first initialise the new empty database schema.