zoukankan      html  css  js  c++  java
  • flyway maven plugin无法正常使用: Unable to connect to the database. Configure the url, user and password!

    在pom.xml依赖中添加configuration内容,如下:

    <plugin>
    				<groupId>org.flywaydb</groupId>
    				<artifactId>flyway-maven-plugin</artifactId>
    				<version>4.2.0</version>
    				<!--	configuration配置 url,user,password不然plugin无法正常使用			-->
    				<configuration>
    					<url>jdbc:mysql://localhost:3306/scis?useUnicode=true&amp;zeroDateTimeBehavior=convertToNull&amp;autoReconnect=true&amp;characterEncoding=utf-8&amp;serverTimezone=CTT</url>
    					<user>root</user>
    					<password>123456</password>
    				</configuration>
    			</plugin>
    
    

    测试flyway info执行结果:

    "C:Program FilesJavajdk1.8.0_231injava.exe" -Dmaven.multiModuleProjectDirectory=D:springgwscis-master -Dmaven.home=D:apache-maven-3.6.3 -Dclassworlds.conf=D:apache-maven-3.6.3inm2.conf "-Dmaven.ext.class.path=D:IntelliJ IDEA 2020.1.2pluginsmavenlibmaven-event-listener.jar" "-javaagent:D:IntelliJ IDEA 2020.1.2libidea_rt.jar=57367:D:IntelliJ IDEA 2020.1.2in" -Dfile.encoding=UTF-8 -classpath D:apache-maven-3.6.3ootplexus-classworlds-2.6.0.jar;D:apache-maven-3.6.3ootplexus-classworlds.license org.codehaus.classworlds.Launcher -Didea.version2020.1.2 -s D:apache-maven-3.6.3confsettings.xml -Dmaven.repo.local=D:apache-maven-3.6.3
    epository org.flywaydb:flyway-maven-plugin:4.2.0:info
    [INFO] Scanning for projects...
    [INFO] 
    [INFO] ---------------------------< com.jcohy:scis >---------------------------
    [INFO] Building scis 0.0.1-SNAPSHOT
    [INFO] --------------------------------[ jar ]---------------------------------
    [INFO] 
    [INFO] --- flyway-maven-plugin:4.2.0:info (default-cli) @ scis ---
    [INFO] Flyway 4.2.0 by Boxfuse
    Thu Jul 09 09:13:11 GMT+08:00 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.
    [INFO] Database: jdbc:mysql://rm-2zed2d1o5ujtu72g7no.mysql.rds.aliyuncs.com:3306/scis?useUnicode=true&zeroDateTimeBehavior=convertToNull&autoReconnect=true&characterEncoding=utf-8&serverTimezone=CTT (MySQL 8.0)
    [INFO] 
    +------------------+------------------------+---------------------+---------+
    | Version          | Description            | Installed on        | State   |
    +------------------+------------------------+---------------------+---------+
    | 1.0.0.20180406.1 | SCIS DB INIT           | 2020-06-29 14:46:08 | Success |
    | 1.0.0.20180407.1 | ADD  TABLE ALLOTPRO    | 2020-06-29 14:46:10 | Success |
    | 1.0.0.20180410.2 | ADD  TABLE Notice      | 2020-06-29 14:46:11 | Success |
    | 1.0.0.20180416.1 | ADD  TABLE FIELD       | 2020-06-29 14:46:13 | Success |
    | 1.0.0.20180416.2 | ADD  SOME DATA         | 2020-06-29 14:46:16 | Success |
    | 1.0.0.20180510.1 | ADD  TABLE CIRCULAR    | 2020-06-29 14:46:18 | Success |
    | 1.0.0.20180510.2 | ADD  TABLE FIELD       | 2020-06-29 14:46:19 | Success |
    | 1.0.0.20180510.3 | ADD  TABLE FIELD       | 2020-06-29 14:46:20 | Success |
    | 1.0.0.20180517.1 | ADD  TABLE FIELD       | 2020-06-29 14:46:21 | Success |
    | 1.0.0.20180517.2 | ADD  FORGIN KEY        | 2020-06-29 14:46:23 | Success |
    | 1.0.0.20180517.3 | CHANGE  CIRCULAR FIELD | 2020-06-29 14:46:24 | Success |
    | 1.0.0.20180518.1 | ADD PROJECT DATE       | 2020-06-29 14:46:26 | Success |
    | 1.0.0.20180522.1 | DELETE PROJECT FIELD   | 2020-06-29 14:46:27 | Success |
    | 1.0.0.20180524.1 | CHANGE  NUM FIELD      | 2020-06-29 14:46:29 | Success |
    | 1.0.0.20180525.1 | ADD DEPT FIELD         | 2020-06-29 14:46:31 | Success |
    | 1.0.0.20180527.1 | ADD DEPT FIELD         | 2020-06-29 14:46:33 | Success |
    | 2.0.0.20200708.1 | SCIS DB INIT           | 2020-07-08 17:50:50 | Success |
    +------------------+------------------------+---------------------+---------+
    
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  3.237 s
    [INFO] Finished at: 2020-07-09T09:13:12+08:00
    [INFO] ------------------------------------------------------------------------
    
    
  • 相关阅读:
    database使用
    画图工具
    宝塔面板权限不足问题解决
    nginx查看并发数量
    台式机未插入扬声器或者耳机
    键盘出现乱码解决
    lnmp宝塔面板问题
    nginx+mysql双主搭建
    zabbix客户端安装
    java生产条形码
  • 原文地址:https://www.cnblogs.com/famine/p/13271796.html
Copyright © 2011-2022 走看看