1

The documentation on the Liquibase website says that I can use the full connection string in the --url parameter such as

jdbc:postgresql://host:port/database?user=user&password=secret

yet when I run any command such as

liquibase history --url='jdbc:postgresql://host:port/database?user=user&password=secret'

I get the following error:

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.

It looks like the & makes Liquibase split the connection string into two commands. It works if I provide the --user and --password parameters separately : liquibase history --url='jdbc:postgresql://host:port/database --user='user' --password='secret'.

Am I doing something wrong? I'm running this in PowerShell.

Alexandru Antochi
  • 1,295
  • 3
  • 18
  • 42

1 Answers1

0

Your connection string should look something like:

postgresql://[user[:password]@][netloc][:port][/dbname][?param1=value1&...]

So it should be:

liquibase history --url='jdbc:postgresql://user:password@host:port/database'

Thanks to https://stackoverflow.com/a/20722229/2864019

Josep Pascual
  • 168
  • 1
  • 7