How to configure and use mysql database in Camunda

Camunda uses the pre-configured H2 database by default. The database schema and all necessary tables will be automatically created when the engine is started for the first time. If you want to use a custom independent database, how to configure the mysql database for Camunda, please follow the steps below:

One, create a new mysql database

Create a database schema for the Camunda platform, named camunda715

Insert picture description here

Two, import the SQL script

Execute the SQL DDL script that creates all the necessary tables and default indexes. These scripts can be found in the configuration/sql/create folder. There are 2 scripts in total, all of which need to be imported.

Insert picture description here


The table structure after the import is complete, a total of 40 tables:

Insert picture description here

Three, configure the data source

Find the camunda-bpm-run-7.15.0\configuration\default.yml file in the installation directory, modify the configuration of the datasource to mysql, and add the JDBC URL and login credentials to the configuration file, as follows:

Insert picture description here
  url: jdbc:mysql://127.0.0.1:3306/camunda715?characterEncoding=UTF-8&useUnicode=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai
  driver-class-name: com.mysql.cj.jdbc.Driver
  username: root
  password: root

Fourth, replace the database driver package

Find camunda-bpm-run-7.15.0\configuration\ userlib in the installation directory, delete the h2 driver package, and place the mysql driver package.

Insert picture description here

Five, restart camunda

Insert picture description here

Six, login verification

After the startup is complete, log in to http://127.0.0.1:8080/camunda/app/admin/default/#/login, enter the demo/demo account to log in

Insert picture description here

Check the database act_id_user table, a default data has been initialized, indicating that camunda has successfully connected to mysql.

Insert picture description here

Seven, summary

The database types supported by Camunda 7.15 version are as follows, please choose according to the project situation:
• MySQL 5.6 / 5.7 / 8.0
• MariaDB 10.2 / 10.3
• Oracle 12c / 18c / 19c
• IBM DB2 10.5 / 11.1 (excluding IBM z/OS for all versions )
• PostgreSQL 9.6 /
10/11/12/13 • Amazon Aurora PostgreSQL compatible with PostgreSQL 9.6 / 10.4 / 10.7 / 10.13 / 12.4
• Microsoft SQL Server 2012/2014/2016/2017/2019 (see Configuration Note)
• H2 1.4 ( not recommended for Cluster Mode-see Deployment Note)
• CockroachDB v20.1.3 (see Configuration guide for more details)