liquibase - 为什么在 liquibase 中运行 DIFF 命令时出现用户名错误?
问题描述
尝试运行 Diff 命令时,我相当确定我的命令是正确的,但是每次运行时都会收到“--userName=Root: command not found”错误。没有任何执行。请参阅下面的命令和结果。任何想法以及为什么?请注意,为了便于阅读,我在命令行中添加了换行符,当我输入命令时,它都在一行上。
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.
解决方案
我怀疑 bash 解析错误。尝试将 url 括在引号中或将整个--url=<connectstring>
参数括在引号中。
另一种选择是将参数放入liquibase.properties
文件中,这样您就不必在命令行上指定它们。您甚至可以设置不同的属性文件并指定--defaultsFile=</path/to/file>
为不同的环境使用不同的文件。如果您不指定该选项,liquibase 将查找名为liquibase.properties
推荐阅读
- javascript - 使用 html css 和 js 划分的汉堡包下拉菜单
- sql - 计算客户余额的最佳方法是什么?
- swift - 有没有更好的方法来处理 Sprite Kit 中的结果逻辑?(迅速)
- angular - Angular 5+ 无法保存结果形式的可观察响应
- java - Windows 与 linux 上的另一个 Mysql 数据库编码字符
- javascript - 9 个字符的正则表达式,其中 8 必须是数字
- python - 来自 SQL 模型的 Qt 自定义多选 QComboBox
- angular - 使用 http 时,在订阅之外未定义变量
- dns - 如何使它在我键入 test.com 时从 b.test.com 打开文件?
- html - 如何使用 CSS 只选择前三个元素