Change h2 db to MYSQL in Flowable-Rest Example

Modify the “flowable-rest\WEB-INF\classes\db.properties” with below content.
db=mysql
datasource.driver=com.mysql.jdbc.Driver
datasource.url=jdbc:mysql://localhost:3306/flowable
datasource.username=root
datasource.password=root

Once save this file ,Restart your tomcat server ,it will connect to MYSQL db.

Note: If you are trying to connect MYSQL 5.5 server ,you may face syntax error while starting the tomcat.because of “timestamp(6)” in the following create query. Instead of “timestamp(6)”, use “timestamp” then it will work.

CREATE TABLE flowable.ACT_CO_CONTENT_ITEM (
ID_ VARCHAR(255) NOT NULL,
NAME_ VARCHAR(255) NOT NULL,
MIME_TYPE_ VARCHAR(255) NULL,
TASK_ID_ VARCHAR(255) NULL,
PROC_INST_ID_ VARCHAR(255) NULL,
CONTENT_STORE_ID_ VARCHAR(255) NULL,
CONTENT_STORE_NAME_ VARCHAR(255) NULL,
FIELD_ VARCHAR(400) NULL,
CONTENT_AVAILABLE_ BIT(1) DEFAULT 0 NULL,
CREATED_ timestamp(6) NULL,
CREATED_BY_ VARCHAR(255) NULL,
LAST_MODIFIED_ timestamp(6) NULL,
LAST_MODIFIED_BY_ VARCHAR(255) NULL,
CONTENT_SIZE_ BIGINT DEFAULT 0 NULL,
TENANT_ID_ VARCHAR(255) NULL,
CONSTRAINT PK_ACT_CO_CONTENT_ITEM PRIMARY KEY (ID_));

This code you will find in “flowable-content-engine-6.2.0.jar” file. Please update this jar with proper query in the flowable-content-db-changelog.xml file.

Thanks for reporting, we’ll fix it. The .sql file is autogenerated using Liquibase, but the behaviour doesn’t seem to be properly working for mysql 5.5. Removing the (6) from the Liquibase file generally is not a good idea, as it’s needed for other databases.

Do note that when using Mysql 5.5 you won’t have support for storing fractional parts of timestamps (which you typically want). 5.6 and 5.7 don’t have this problem.

Thanks joram for clarification.