Having custom MySQL database along with camunda's MySQL in the same Camunda Spring boot application

I want to use 2 relational databases(MYSQL) in Camunda Spring boot application one for Camunda fields which starts with “act…” and other one to application use to save the variables. I have added the application.properties to use primary datasource (for Camunda DB) and other for application’s one as below:

#==== Camunda MySQL(primary) ======#
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://localhost:3306/camundapoc?useSSL=false
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.jpa.properties.hibernate.dialect =org.hibernate.dialect.MySQL5Dialect
camunda.bpm.database.schema-name=camundapoc

#==== Application’s MySQL(secondary) for business use ======#
secondary.datasource.jpa.hibernate.ddl-auto=update
secondary.datasource.datasource.url=jdbc:mysql://localhost:3306/mycamundadb?useSSL=false
secondary.datasource.datasource.username=root
secondary.datasource.datasource.password=root
and added dbconfig file to pick these secondary properties

The real problem occurs when camunda detects both the MYSQL database and loads the camunda tables.But I want it to load in only primary db which is “camundapoc”. Please let me know a way to possibly avoid this problem and I would like JPA to load tables in mycamundadb based on the entities defined. Thanks in advance :slight_smile:

Hello

are you really can built a database along Camunda’s tables?
how can you did that? because i want to have a datasource along Camunda’s tables

Hi @Gaurav_Mulay,
Me too I have a spring boot app, and I want to start first with camunda database, so I want to use Mysql instead of H2. I’ve replaced h2 dependency with mysql jdbc driver dependency, and configured application.properities file as shown here Mysql JDBC url
But I don’t know what to do next :thinking:
Thank you

I missed spring-boot-starter-jdbc dependency, please add it, in addition to the jdbc chosen dependency, and the configuration too (my comment above :point_up_2:). I’ve solved my issue through another topic (link below)
https://forum.camunda.io/t/spring-boot-transactionmanager-error-when-using-postgres/7930