Caused by: org.flywaydb.core.api.FlywayException: Unsupported Database: MySQL 5.7

问题表现

Caused by: org.flywaydb.core.api.FlywayException: Unsupported Database: MySQL 5.7
	at org.flywaydb.core.internal.database.DatabaseTypeRegister.getDatabaseTypeForConnection(DatabaseTypeRegister.java:106)
	at org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.<init>(JdbcConnectionFactory.java:76)
	at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:147)
	at org.flywaydb.core.Flyway.migrate(Flyway.java:124)
	at org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:66)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
	... 18 common frames omitted

问题原因

flyway-core 8.2.1及以后的版本 单独包flyway-core 不再支持MySQL

解决方式

查询其他解决方式后有两种

  1. 额外增加单独支持包
            <dependency>
                <groupId>org.flywaydbgroupId>
                <artifactId>flyway-mysqlartifactId>
            dependency>
  1. 指定版本到 8.2.0 及之前即可,即降低版本
    手动指定 version 为 8.2.0 或以下 实际测试8.2.0 时依旧不行直接降低到7.10.0后恢复正常,或在 porperties 中指定版本,均可

你可能感兴趣的:(奇怪Bug及不常见问题总结,数据库,mysql)