# Connecting Flowable to mysql insted of H2

**URL:** <https://forum.flowable.org/t/connecting-flowable-to-mysql-insted-of-h2/4143>\
**Category:** Flowable Application\
**Created:** [July 8, 2019, 6:55am UTC](https://forum.flowable.org/t/connecting-flowable-to-mysql-insted-of-h2/4143 "2019-07-08T06:55:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anand](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@Anand](https://forum.flowable.org/u/Anand)\
**Post date:** [July 8, 2019, 6:55am UTC](https://forum.flowable.org/t/connecting-flowable-to-mysql-insted-of-h2/4143/1 "2019-07-08T06:55:59Z")

</div>

Hi All,  
I want to configure mysql database with my flowable application can anyone suggest me how can i achieve this, which files do i need to edit in order to achieve this or can it be directly achieve without any code change please help.

---

<div class="post-metadata">

**Author:** ![matthias.stoeckli](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/matthias.stoeckli/32/1278_2.png) [@matthias.stoeckli](https://forum.flowable.org/u/matthias.stoeckli)\
**Post date:** [July 8, 2019, 7:26am UTC](https://forum.flowable.org/t/connecting-flowable-to-mysql-insted-of-h2/4143/2 "2019-07-08T07:26:34Z")

</div>

Hi Anand!

You can configure the database through properties. In the following examples, I’m assuming that you properly set up your DB with a schema named `flowable`.

**Configuration**  
If you are building a Spring app, you can simply add the following lines to your `application.properties` files located in your resources:

```auto
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/flowable?characterEncoding=UTF-8
spring.datasource.username=flowable
spring.datasource.password=flowable

```

If you are not using Spring and configure your engines with the `flowable.cfg` file, you’ll have to add the following:

```xml
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

<!-- Data Source -->
  <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" >
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property name="url" value="jdbc:mysql://localhost:3306/flowable" />
    <property name="username" value="flowable" />
    <property name="password" value="flowable" />
    <property name="defaultAutoCommit" value="false" />
  </bean>
<!-- Rest of your configuration -->

</beans>

```

This will directly configure the data source of your application. You can also change the `jdbcUrl`, `jdbcDriver`, `jdbcUsername` and `jdbcPassword` directly, see here:  
[https://www.flowable.org/docs/userguide/index.html#databaseConfiguration](https://www.flowable.org/docs/userguide/index.html#databaseConfiguration)

**Connector**  
Also make sure that you add the dependeny to the connector to your `pom.xml` file:

```xml
<dependencies>
<!-- Other dependencies here -->

<!-- Connector -->
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.45</version>
</dependency>

<!-- Other stuff here -->

</dependencies>

```

**Further references**  
You can also have a look at the following sections of the documentation:  
Database configuration in general: [https://www.flowable.org/docs/userguide/index.html#databaseConfiguration](https://www.flowable.org/docs/userguide/index.html#databaseConfiguration)

Database configuration in Spring Boot: [https://www.flowable.org/docs/userguide/index.html#\_changing\_the\_database\_and\_connection\_pool](https://www.flowable.org/docs/userguide/index.html#_changing_the_database_and_connection_pool)

Regards,  
Matthias
