How to .usqlpass
Hello.
I think i am missing something.
We have 2 Microsft SQL servers. MS1 and MS2
I create a .usqlpass file and put the following config
mssql:*:*:*:myusername:password1
mssql:*:*:*:myusername:password2
How to specify in the connection string usql mssql:// that when i want to connect to MS2 server i want the credentials of the line with password2?
The username is the same on both servers. Only the password changes.
One of the entries in .usqlpass needs to have a hostname.
Those two wildcard entries read in English like this:
Connect to any MSSQL server as
myusernamewith the password aspassword1ANDpassword2
Which doesn't really make sense.
Thanks for the info but.
I put this in .usqlpass
mssql:*:*:*:myusername:password1
mssql:10.1.0.10:*:*:myusername:password2
and then tried to connect like this
usql mssql://10.1.0.10/DB_NAME
and says login failed and asked for password.
You need to have the more specific entry first, so switch them. They're matched from top to bottom.
Yes that works. Maybe it has to be better documented. Thank you!
Please see the updated README.md, and use \cset and/or the config.yaml for usql. Thanks.