我正在开发API,并在Gradle中使用Flyway迁移工具。当我运行flywayMigration任务时,出现“无法获取连接”错误。
我尝试了以下URL值-没有一个起作用。
url = "jdbc:mysql://localhost:3306/dataloader"
url = "jdbc:mysql://localhost:3306"
url = "jdbc:mysql://localhost:3306; databasename=dataloader"
build.gradle
---------------
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "mysql:mysql-connector-java:5.1.37"
project(":dataloader-orm")
}
}
plugins {
id "org.flywaydb.flyway" version "5.0.7"
}
group 'com.example.project'
version '0.0.1-SNAPSHOT'
flyway{
url = 'jdbc:mysql://localhost:3306/dataloader'
user = 'root'
password = 'mypassword'
driver = 'com.mysql.jdbc.Driver'
schemas = ["test"]
placeholderReplacement=false
}
V1__initial.sql
----------------
insert into table test values(1);