How can i configure the Spring Boot Starter Application to use mysql instead of h2?

How can i configure the Spring Boot Application to use mysql instead of h2? I added to pom.xml


and to application.yaml i added

    url: jdbc:mysql://
    username: root
    password: s3cr3t

What else should i do?

Hi @mbrain ,
->So you need Dependency:-
1.mysql connector java
2.Data JPA
->You have to download script from here SQL Script
→ Configure your workbench by running Script
→ If any doubt go through this link SQL with Camunda

Hi and thank you. I already created the database, the question is how to configure the camunda spring starter application.

Hi @mbrain ,
Generally we work with Spring right same here also, We will create

  1. Repository class (JPA repository for CRUD operation)
  2. Service class ( Service task , getting value from process and setting in one Entity object, inserting using save() method )
  3. Entity (Creating table and defining getter setter with Needed Variable )
    Instead of H2 , now we will configure our SQL Properties in
    you can go through my code Github Code

I have no file in my camunda spring boot starter project. Please if you can tell me how i can do it in my own project, i dont want to use yours.

yaml file you have right, that is enough @mbrain

But why are you talking about properties file? I want to use a plain camunda spring starter example project. I am very new to that.

See for properties we need one file if it is application.yaml then we have to follow Indentation like you have given , if we are creating then we give value:

camunda.bpm.filter.create=All Tasks

Both work same @mbrain

Ok i see but sorry, can you answer my question? Why is it not working for me? What am i missing?

Go through my Github Link and drop here your code and BPMN in ZIP

But there is a lot more than just mysql.

→ the lombok dependency,
→ the spring-boot-starter-mail,
→ the camunda-connect-soap-http-client,
→ the spring-cloud-starter-config

and more.

Do i need all this stuff for a simple mysql configuration?

The camunda run bundle was way easier to configure, i just dropped the sql-connector.jar into a directory, uncomment the block in pom.xml and that was it.

@mbrain You can refer to this Postgres config example. You can switch it to MySQL.

1 Like

No i dont want your code i want an explaination how to configure my own code.

In order to have MySQL instead of H2, you need to do the following:
In your pom.xml, you need to add the following dependencies:


What are these? The first one is Spring Data JPA, which makes handling data access easier. For more details, you may look here: Spring Data JPA
The second one is the actual connector used to communicate with the database.

Now, having these is only half of what you have to do. If you want to actually use them, as was said before, you need to configure them, which from the code you provided seems to be fine as you have it (in the application.yaml file). As a side note to this, make sure the database actually exists on your MySQL server, because otherwise your application may fail on startup.

Another note that may be of use to you: I would recommend not deleting the H2 dependency from the pom.xml file, because that my still be used during testing and your application may fail without it.