Fix Liquibase running multiple queries in SQL filesWith Spring boot

Elvis Ciotti
Oct 3, 2021

--

If Liquibase doesn’t run multiple queries in your SQL files, one solution you might want to try is adding splitStatement

# db.changelog-master.yaml
databaseChangeLog:
- include: { file: "changes/001.sql", splitStatements: true }

But that didn’t seem to work in Spring boot 2.5.5 and Mysql 8.

To allow multiple queries to run, you need to change the JDBC connection string and add the query param allowMultiQueries=true

# application.properties
spring.datasource.url=jdbc:mysql://yourdb:3306/dbname&allowMultiQueries=true

--

--

Elvis Ciotti
Elvis Ciotti

Written by Elvis Ciotti

Software Contractor — Java, Spring, k8s, AWS, Javascript @ London - hire me at https://elvisciotti.github.io/

No responses yet