username & password for cli
aremund
Posts: 3 New member
Hi all
I am super happy with flyway and we are using it to migrate our database to new versions.
For testing, I use the windows-cli to execute the migrations on databases. Usually, I have the URL, Schema etc. as parameter in a config file but do not configure username and password in this config-file.
I run "flyway migrate" on the command-line and get prompted for the username and password.
Sadly, in the newest version 10.3.0 (as well as 10.2.0) the prompted username and password does not seem to be passed to the JDBC connection and I only get the following error:
Am I doing something wrong or is there a problem?
Thanks for your answers and Merry Christmas!
I am super happy with flyway and we are using it to migrate our database to new versions.
For testing, I use the windows-cli to execute the migrations on databases. Usually, I have the URL, Schema etc. as parameter in a config file but do not configure username and password in this config-file.
I run "flyway migrate" on the command-line and get prompted for the username and password.
Sadly, in the newest version 10.3.0 (as well as 10.2.0) the prompted username and password does not seem to be passed to the JDBC connection and I only get the following error:
ERROR: Unable to obtain connection from database (jdbc:postgresql://xx.xx.xx:xxxx/db) for user 'null': The server requested password-based authentication, but no password was provided by plugin nullIf I configure the username and password in the configuration-file (with flyway.user= and flyway.password=) all works fine.
Am I doing something wrong or is there a problem?
Thanks for your answers and Merry Christmas!
Answers
Please can you clarify, on the command line are calling the connection like this
flyway migrate <url> <user> <password>
or
flyway migrate <url>
and then expecting flyway to prompt you for credentials interactively?
Thanks a lot for checking on my problem and sorry for the late response.
If I am calling the connection with username and password as a parameter, everything works fine:
However, I try to avoid entering the password directly on the command-line and prefer flyway prompting me for the password. If I am doing that, the password does not seem to be passed to the connection:
I hope that clarifies further about my problem.
Kind regards,
Alain
I'll keep you posted.
After reviewing the functionality and the minimal documentation regarding, it's been concluded that this legacy behaviour is rather antithetical to tooling's intent and should be deprecated in the near future as there are now much better and more reliable means with which to achieve the same result.
This is detailed in greater depth here.
https://documentation.red-gate.com/flyway/flyway-blog/deprecation-of-flyway-s-interactive-behavior
I recognise this isn't what you asked and I apologise for that, I'm hopeful that the alternatives will be superior. Should you have any issues implementing the alternatives, please do reach out!
Thanks for the clear answer. Of course it is a bit unfortunate for my case but your reasoning is well explained in the linked blog-entry.
Thanks a lot and keep up the good work!