liquibase - Liquibase 无法使用用户名和密码读取 jdbc postegresql 连接字符串
问题描述
Liquibase 网站上的文档说我可以在--url
参数中使用完整的连接字符串,例如
jdbc:postgresql://host:port/database?user=user&password=secret
但是当我运行任何命令时,例如
liquibase history --url='jdbc:postgresql://host:port/database?user=user&password=secret'
我收到以下错误:
Unexpected error running Liquibase: Connection could not be created to jdbc:postgresql://host:5432/database?user=user with driver org.postgresql.Driver. The server requested password-based authentication, but no password was provided.
For more information, please use the --log-level flag
'password' is not recognized as an internal or external command,
operable program or batch file.
看起来&
Liquibase 将连接字符串拆分为两个命令。如果我单独提供--user
and--password
参数,它会起作用:liquibase history --url='jdbc:postgresql://host:port/database --user='user' --password='secret'
。
难道我做错了什么?我在 PowerShell 中运行它。
解决方案
您的连接字符串应类似于:
postgresql://[user[:password]@][netloc][:port][/dbname][?param1=value1&...]
所以应该是:
liquibase history --url='jdbc:postgresql://user:password@host:port/database'
推荐阅读
- vue.js - vue组件使用常用功能
- c# - 从 JSON 保存和加载不同类型的 C# 列表
- python - 从具有不同结构的不同域(大部分)中抓取多个单页
- c++ - cv::Mat 回退到 std::vector 问题
- revit-api - Revit FacingOrientation 为天窗提供了错误的方向
- java - 如何在java中更改私有变量的值
- python - 具有内存数据的分布式 TensorFlow
- angularjs - AngularJS $stateProvider - 从子状态更改父模板视图
- python - OpenCV GrabCut 移除背景
- mysql - 如何在没有子查询的单个 SQL 查询中汇总这些记录?