Unsupported Database: MariaDB 10.4
See original GitHub issueWhich version and edition of Flyway are you using?
7.8.2 (latest)
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Java API
Which database are you using? (Type & version)
MariaDB 10.4
Which operating system are you using?
Debian 10
What did you do? (Please include the content causing the issue, any relevant configuration settings, the SQL statement(s) that failed (if any), and the command you ran)
var flyway = Flyway.configure(classLoader).dataSource(dataSource).load();
try {
flyway.migrate();
} catch (final FlywayException e) {
return Result.error(e);
}
What did you expect to see?
Successful migration
What did you see instead?
[21:01:49 INFO]: [org.flywaydb.core.internal.license.VersionPrinter] Flyway Community Edition 7.8.2 by Redgate
[21:01:49 INFO]: [com.zaxxer.hikari.HikariDataSource] SamplePool - Starting...
[21:01:49 INFO]: [com.zaxxer.hikari.HikariDataSource] SamplePool - Start completed.
[21:01:49 ERROR]: [ExamplePlugin] Jdbc url: jdbc:mariadb://127.0.0.1:3306/app?useUnicode=true&characterEncoding=utf-8&useSSL=false
[21:01:49 ERROR]: [ExamplePlugin] Migration error:
org.flywaydb.core.api.FlywayException: Unsupported Database: MariaDB 10.4
at org.flywaydb.core.internal.database.DatabaseTypeRegister.getDatabaseTypeForConnection(DatabaseTypeRegister.java:143) ~[?:?]
at org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.<init>(JdbcConnectionFactory.java:69) ~[?:?]
at org.flywaydb.core.Flyway.execute(Flyway.java:505) ~[?:?]
at org.flywaydb.core.Flyway.migrate(Flyway.java:165) ~[?:?]
at ru.example.clans.service.simple.SqlMigrateService.migrate(SqlMigrateService.java:30) ~[?:?]
at ru.example.clans.ExamplePlugin.onPluginEnable(ExamplePlugin.java:95) ~[?:?]
at ru.coder.api.BenioPlugin.onEnable(BenioPlugin.java:51) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.5.jar:git-Paper-638]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:380) ~[patched_1.16.5.jar:git-Paper-638]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:483) ~[patched_1.16.5.jar:git-Paper-638]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:501) ~[patched_1.16.5.jar:git-Paper-638]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:415) ~[patched_1.16.5.jar:git-Paper-638]
at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:591) ~[patched_1.16.5.jar:git-Paper-638]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:281) ~[patched_1.16.5.jar:git-Paper-638]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1065) ~[patched_1.16.5.jar:git-Paper-638]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:289) ~[patched_1.16.5.jar:git-Paper-638]
at java.lang.Thread.run(Thread.java:832) [?:?]
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top Results From Across the Web
FlywayException : Unsupported Database: MariaDB 10.5
Does it mean the support of flyway is supported only till mariadb 10.4 version ? Any suggestions/ help. spring-boot · flyway · mariadb-10.5....
Read more >MariaDB - Flyway by Redgate • Database Migrations Made ...
MariaDB support is a separate dependency for Flyway and will need to be added to your Java project to access these features. MariaDB...
Read more >Upgrading from MariaDB 10.3 to MariaDB 10.4
How to Upgrade; Incompatible Changes Between 10.3 and 10.4 ... Before you upgrade, it would be best to take a backup of your...
Read more >Unsupported Database: MariaDB 10.5-Springboot
[Solved]-FlywayException : Unsupported Database: MariaDB 10.5-Springboot ... From Flyway 8.2.1, both MySQL and MariaDB database support has been part of a ...
Read more >MySQL Governor allows upgrades to unsupported versions of ...
Symptoms MariaDB 10.4 cause issues with loading phpMyAdmin from the cPanel ... Cpanel::Exception::Database::Error/(XID owejf4j) The system ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Test case with JUnit 5:
I ran into this same problem. Unit tests pass but migration fails in the deployment environment. It occurs when Flyway and the user code is in a child ClassLoader, which is unreachable from the context ClassLoader.
On previous versions, in my case 7.7.1, using
Flyway.configure(classLoader)
works fine and allows Flyway to detect migrations reachable in the specified ClassLoader which are not available in the context ClassLoader.The issue is that the
ServiceLoader.load(Class)
uses the context ClassLoader:https://github.com/flyway/flyway/blob/7f9921a58eb3b35a217e47e3dd1bf9a787386175/flyway-core/src/main/java/org/flywaydb/core/internal/database/DatabaseTypeRegister.java#L54
To solve this,
ServiceLoader.load(Class, ClassLoader)
can be used instead. It probably should be used instead, considering the context loader is more of a mechanism to workaround inflexible existing APIs (from what I understand).