Home > Software design >  Flyway detects an incompatible MySQL version even though the documentation says it is compatible
Flyway detects an incompatible MySQL version even though the documentation says it is compatible

Time:12-29

I've updated Spring Boot to version 3.0.1 and to also tried to update Flyway to version 9.10.1.

...
dependencies {
    // Spring
    implementation("org.springframework.boot:spring-boot-starter-actuator")
    implementation("org.springframework.boot:spring-boot-starter-jooq")
    implementation("org.springframework.boot:spring-boot-starter-mail")
    implementation("org.springframework.boot:spring-boot-starter-web")
    implementation("org.springframework.security:spring-security-oauth2-resource-server")
    implementation("org.springframework.security:spring-security-oauth2-jose")
    implementation("org.springframework.security:spring-security-config")

    // Jooq
    implementation("org.jooq:jooq:3.17.6")
    implementation("org.jooq:jooq-meta:3.17.6")
    implementation("org.jooq:jooq-codegen:3.17.6")
    jooqGenerator("mysql:mysql-connector-java:8.0.31")
    jooqGenerator('jakarta.xml.bind:jakarta.xml.bind-api:4.0.0')

    // Flyway
    implementation('org.flywaydb:flyway-core:9.10.1')
}
...

Without the Flyway dependency my application is starting and working as expected. But with Flyway enabled the application keeps crashing and stating that the db version is not supported:

Caused by: org.flywaydb.core.api.FlywayException: Unsupported Database: MySQL 8.0
    at org.flywaydb.core.internal.database.DatabaseTypeRegister.getDatabaseTypeForConnection(DatabaseTypeRegister.java:106) ~[flyway-core-8.5.13.jar:na]

But the official documentation states that MySQL 8.0 is supported: https://documentation.red-gate.com/fd/mysql-184127601.html

Any help is appreciated.

CodePudding user response:

MySQL support was extracted to a separate dependency in Flyway 8.2.1.

It needs to be added as per the Java Usage instructions.

e.g.

dependencies {
    implementation("org.flywaydb:flyway-mysql")
}
  • Related