首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么在liquibase中运行DIFF命令时会出现UserName错误?

为什么在liquibase中运行DIFF命令时会出现UserName错误?
EN

Stack Overflow用户
提问于 2019-06-26 20:36:07
回答 1查看 89关注 0票数 0

尝试运行Diff命令时,我相当确定我的命令是正确的,但是每次我运行时都会得到一个"--userName=Root: command not found“错误。什么都不会执行。请参阅下面的命令和结果。有没有想过为什么呢?请注意,为了便于阅读,我在命令行中添加了换行符,当我输入命令时,所有内容都在一行中。

代码语言:javascript
复制
liquibase 
--driver=com.mysql.cj.jdbc.Driver 
--url=jdbc:mysql://localhost/dev?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC 
--userName=root 
--password=SomePassword 
--logLevel=debug diff 
--referenceUrl=jdbc:mysql://localhost/Prod?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC 
--referenceUsername=root 
--referencePassword=SomePassword
[1] 5437
[2] 5438
[3] 5439
[4] 5440
[5] 5441
[6] 5442
-bash: --userName=root: command not found
-bash: --referenceUsername=root: command not found
[2]   Done                    useJDBCCompliantTimezoneShift=true
[3]   Done                    useLegacyDatetimeCode=false
[5]-  Done                    useJDBCCompliantTimezoneShift=true
[6]+  Done                    useLegacyDatetimeCode=false
[4]+  Exit 127                serverTimezone=UTC --userName=root --password=SomePassword --logLevel=debug diff --referenceUrl=jdbc:mysql://localhost/Prod?useUnicode=true
macbook:~ name$ Starting Liquibase at Wed, 26 Jun 2019 07:22:10 CDT (version 3.6.3 built at 2019-01-29 11:34:48)
Errors:
  No command was passed.
EN

回答 1

Stack Overflow用户

发布于 2019-06-27 00:58:22

我怀疑是bash解析错误。尝试用引号将--url=<connectstring>括起来,或者用引号将整个urls参数括起来。

另一种选择是将参数放入liquibase.properties文件中,这样就不必在命令行中指定它们。您甚至可以设置不同的属性文件,并指定--defaultsFile=</path/to/file>为不同的环境使用不同的文件。如果不指定该选项,则liquibase将查找名为liquibase.properties文件

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56772999

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档