【发布时间】:2021-01-03 02:17:31
【问题描述】:
我有一个 maven 项目,我正在尝试使用 MySQL 脚本创建带有 flyway 的表。
我的配置文件包括
flyway.driver=com.mysql.jdbc.Driver
flyway.url=jdbc:mysql://127.0.0.1:3306/atm
flyway.user=root
flyway.password=root1234
flyway.locations=filesystem:/flyway/migrations
flyway.sqlMigrationPrefix=V
flyway.sqlMigrationSeparator=__
flyway.validateOnMigrate=true
这是 SQL 脚本文件。
CREATE TABLE `atm_table` (
`id` int(11) NOT NULL,
`name` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
当我执行命令mvn flyway:migrate -X 时,它只会创建flyway_schema_history 表。在日志中显示为
[DEBUG] Unable to load config file: /Users/name/flyway.conf
[DEBUG] Loading config file: /Users/name/my-project/flyway/conf/flyway.conf
Loading class 'com.mysql.jdbc.Driver'. This is deprecated. The new driver class is 'com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
[INFO] Flyway Community Edition 6.5.0 by Redgate
[DEBUG] Scanning for filesystem resources at '/my-project/flyway/migrations'
[WARNING] Skipping filesystem location:/my-project/flyway/migrations (not found). Note this warning will become an error in Flyway 7.
Wed Sep 16 16:32:45 IST 2020 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
似乎它不是指正确的文件位置(配置文件中给出的位置)。如何解决这个问题?
【问题讨论】: