Unsupported Database: MySQL 8.0
vifeng
Posts: 6 New member
Which version and edition of Flyway are you using?
Flyway Community 8.2.1
Which client are you using?
Gradle Version: 8.2.1 plugin
or
Flyway OSS Edition 10.11.1 by Redgate in command line
Which database are you using? (Type & version)
Mysql on google cloud sql MySQL 8.0.31
Which operating system are you using?
Mac
later i will be using docker with linux (please suggest anything that could help or an example. Thanks)
What did you do?
I'm a beguinner working on my own, thank you for your comprehension and being very clear.
I was on h2 and migrated to gcp mysql. I had trouble with the no database found error when running `flyway clean` or `gradle flywayClean` it has been corrected and is running ok. I also use a `/Users/.../[project]/flyway.conf` to connect to the database. Since this problem has been cleared I run `gradle bootRun` and it doesn't work
here is my build.gradle.kts
<div>```kts</div><div>plugins {</div><div> id("java")</div><div> id("org.springframework.boot") version "3.2.5" </div><div> id("io.spring.dependency-management") version "1.1.4"</div><div> id("org.asciidoctor.jvm.convert") version "3.3.2"</div><div> id("com.diffplug.spotless") version "6.25.0"</div><div> id("org.flywaydb.flyway") version "10.11.1"</div><div>}</div><div><br></div><div>dependencyManagement {</div><div> imports {</div><div> mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)</div><div> }</div><div>}</div><div><br></div><div>group = "com.vf"</div><div>version = "0.0.1-SNAPSHOT"</div><div><br></div><div>java {</div><div> sourceCompatibility = JavaVersion.VERSION_17</div><div>}</div><div><br></div><div>springBoot {</div><div> mainClass.set("com.vf.eventhubserver.EventhubServerApplication")</div><div>}</div><div><br></div><div>configurations {</div><div> compileOnly {</div><div> extendsFrom(configurations.annotationProcessor.get())</div><div> }</div><div>}</div><div>repositories {</div><div> mavenCentral()</div><div> maven {</div><div> url = uri("https://download.red-gate.com/maven/release")</div><div> }</div><div>}</div><div><br></div><div>buildscript {</div><div> repositories {</div><div> mavenCentral()</div><div> }</div><div> dependencies {</div><div> classpath("org.flywaydb:flyway-mysql:10.11.1")</div><div> }</div><div>}</div><div><br></div><div>val snippetsDir by extra { file("build/generated-snippets") }</div><div>val asciidoctorExt by configurations.creating</div><div><br></div><div><br></div><div>dependencies {</div><div> implementation(platform("com.google.cloud:spring-cloud-gcp-dependencies:4.1.4"))</div><div> implementation("com.google.cloud:spring-cloud-gcp-starter-sql-mysql")</div><div> implementation("com.google.cloud:google-cloud-secretmanager")</div><div><br></div><div> implementation ("mysql:mysql-connector-java:8.0.31")</div><div> implementation("org.flywaydb:flyway-core:10.11.1")</div><div><br></div><div> implementation ("com.google.code.findbugs:jsr305:3.0.2")</div><div> implementation("org.springframework.data:spring-data-rest-hal-explorer")</div><div> asciidoctorExt("org.springframework.restdocs:spring-restdocs-asciidoctor")</div><div> implementation("org.springframework.boot:spring-boot-starter-actuator")</div><div> implementation("org.springframework.boot:spring-boot-starter-data-jpa")</div><div> implementation("org.springframework.boot:spring-boot-starter-validation")</div><div> implementation("org.springframework.boot:spring-boot-starter-web")</div><div> implementation("org.springframework.boot:spring-boot-starter-webflux")</div><div> implementation("org.springframework.session:spring-session-core")</div><div> implementation ("org.mapstruct:mapstruct:1.5.5.Final")</div><div> annotationProcessor ("org.mapstruct:mapstruct-processor:1.5.5.Final")</div><div> implementation("org.springframework.boot:spring-boot-devtools")</div><div> // runtimeOnly("com.h2database:h2")</div><div> testImplementation("org.springframework.boot:spring-boot-starter-test")</div><div> testImplementation("io.projectreactor:reactor-test")</div><div> testImplementation("org.springframework.restdocs:spring-restdocs-mockmvc")</div><div> testAnnotationProcessor("org.mapstruct:mapstruct-processor:1.5.5.Final")</div><div>}</div><div><br></div><div>spotless {</div><div> java {</div><div> target("src/**/*.java")</div><div> googleJavaFormat()</div><div> removeUnusedImports()</div><div> }</div><div>}</div><div><br></div><div>asciidoctorj {</div><div> fatalWarnings(listOf(missingIncludes()))</div><div>}</div><div><br></div><div>tasks.withType<JavaCompile>().configureEach{</div><div> options.encoding = "UTF-8"</div><div>}</div><div><br></div><div>tasks.withType<Javadoc>().configureEach{</div><div> options.encoding = "UTF-8"</div><div>}</div><div><br></div><div>tasks.test {</div><div> systemProperty("file.encoding", "UTF-8")</div><div> useJUnitPlatform()</div><div> outputs.dir(snippetsDir)</div><div>}</div><div><br></div><div>tasks.asciidoctor {</div><div> inputs.dir(snippetsDir)</div><div> configurations(listOf(asciidoctorExt))</div><div> dependsOn("test")</div><div> attributes(mapOf("snippets" to snippetsDir))</div><div> outputOptions{</div><div> backends ("html5")</div><div> }</div><div> options(mapOf("doctype" to "book"))</div><div>}</div><div><br></div><div>tasks.jar {</div><div> dependsOn("asciidoctor")</div><div> from ("${snippetsDir}/html5") {</div><div> into ("static/docs")</div><div> }</div><div>}</div><div><br></div><div>// A custom task to delete all the files and folders generated by Gradle</div><div>tasks.register<Delete>("clearAll") {</div><div> delete("bin")</div><div> delete (".classpath")</div><div> delete (".gradle")</div><div> delete (".nb-gradle")</div><div> delete (".project")</div><div> delete (".settings")</div><div> // delete (".vscode")</div><div> delete (".DS_Store")</div><div> delete (".idea")</div><div> dependsOn(tasks.clean)</div><div>}</div><div><br></div><div>```</div>
What did you expect to see?
I expected `gradle bootRun` to work as before (just well!).
What did you see instead? And what is your understanding of the situation:
I understand my connector and core versions are not compatible. But the doc says it's ok for 8.0 I that's what i have. So what version should I use and above all, where/how do I find this info ? I really looked into your doc, nothing (same for the buildscript by the way.) I also looked into maven central i haven't find anything about compatibility. I would very much appreciate your answer so I would know for the futur.
error message :
<div>```</div><div>Application run failed</div><div><br></div><div>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Unsupported Database: MySQL 8.0</div><div> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1786) ~[spring-beans-6.1.6.jar:6.1.6]</div><div> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) ~[spring-beans-6.1.6.jar:6.1.6]</div><div> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-6.1.6.jar:6.1.6]</div><div> at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.1.6.jar:6.1.6]</div><div> at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.6.jar:6.1.6]</div><div> at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.1.6.jar:6.1.6]</div><div> at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.1.6.jar:6.1.6]</div><div> at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:313) ~[spring-beans-6.1.6.jar:6.1.6]</div><div> at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.1.6.jar:6.1.6]</div><div> at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1234) ~[spring-context-6.1.6.jar:6.1.6]</div><div> at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:952) ~[spring-context-6.1.6.jar:6.1.6]</div><div> at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624) ~[spring-context-6.1.6.jar:6.1.6]</div><div> at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.5.jar:3.2.5]</div><div> at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.2.5.jar:3.2.5]</div><div> at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.2.5.jar:3.2.5]</div><div> at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[spring-boot-3.2.5.jar:3.2.5]</div><div> at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-3.2.5.jar:3.2.5]</div><div> at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-3.2.5.jar:3.2.5]</div><div> at com.vf.eventhubserver.EventhubServerApplication.main(EventhubServerApplication.java:11) ~[main/:na]</div><div> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]</div><div> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]</div><div> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]</div><div> at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]</div><div> at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:50) ~[spring-boot-devtools-3.2.5.jar:3.2.5]</div><div>Caused by: org.flywaydb.core.api.FlywayException: Unsupported Database: MySQL 8.0</div><div> at org.flywaydb.core.internal.database.DatabaseTypeRegister.lambda$getDatabaseTypeForConnection$7(DatabaseTypeRegister.java:122) ~[flyway-core-10.11.1.jar:na]</div><div> at java.base/java.util.Optional.orElseThrow(Optional.java:403) ~[na:na]</div><div> at org.flywaydb.core.internal.database.DatabaseTypeRegister.getDatabaseTypeForConnection(DatabaseTypeRegister.java:122) ~[flyway-core-10.11.1.jar:na]</div><div> at org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.<init>(JdbcConnectionFactory.java:77) ~[flyway-core-10.11.1.jar:na]</div><div> at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:138) ~[flyway-core-10.11.1.jar:na]</div><div> at org.flywaydb.core.Flyway.migrate(Flyway.java:151) ~[flyway-core-10.11.1.jar:na]</div><div> at org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:66) ~[spring-boot-autoconfigure-3.2.5.jar:3.2.5]</div><div> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1833) ~[spring-beans-6.1.6.jar:6.1.6]</div><div> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782) ~[spring-beans-6.1.6.jar:6.1.6]</div><div> ... 23 common frames omitted</div><div>```</div>
I would gladly provide anything relevant or the build
Tagged:
Answers
I've tweaked your output to be a little easier to read.
Config
Exception
The first thing I don't see that I was expecting is there's no flyway MySQL implementation in your build script, I'm anticipating seeing
(source).
the reason it's here was a no database error which i speaked about and that i read about here : https://github.com/flyway/flyway/issues/3722 and https://github.com/flyway/flyway/issues/3355
When you say initially that you're using Flyway Community 8.2.1 & Flyway OSS Edition 10.11.1 by Redgate in command line, do you mean you've tried both with similar effects?
I'm a little dubious aboutv8 working with all the other newer tech as an asside.
Do you have any recommandation I should try or should I report it as a bug?
here is the code I tried per asked :
```
buildscript {
With a do `flyway clean` I have the no database error again as such if I do now I have this trace : (it's just the end)