1

Can we create "Server Aliases" in Linux clients (webservers etc.) so that you can change connections without touching the application's DB URL string?

The official documentation seems to talk about a GUI way of doing this in Windows, so I was wondering if something like this exists for Linux. This has lots of benefits, especially during containerization of apps.


My high level objective is to see if I can create some level of indirection so that the application always thinks of DB as DSN=myDsn;Uid=myUsername;Pwd=myPwd; while the real driver redirects it to DSN=realDsn;Uid=realUsername;Pwd=realPwd;. Initially I was thinking of something like socat, but I am not sure how password changes can be handled! "Server Aliases for client" seems to do something like this, hence the question.

asked Oct 14, 2020 at 17:50

1 Answer 1

2

Aliases on Windows are set using the SQL Server Configuration Manager GUI. The Linux equivalent is mssql-conf, but there isn't an equivalent to aliases on Linux.

(I don't think this is a case of "isn't supported yet" related to Linux support being relatively new. My guess on the future is just a hunch & guessing rather than fact.)

If you need server name redirection, I'd recommend using a CNAME to redirect that name for all clients centrally, rather than a client by client setting. Alternatively, I'd use the hosts file to redirect from one server name to another.

If you need to also do credential impersonation (your example implies this), allowing the user to supply one credential, and using something different to connect to the database, that sounds like something to be handled by your application, rather than expecting the drivers to do it for you.

answered Oct 15, 2020 at 0:22
1
  • Thank you for clarifying this. Agree, application seems to be the right place for storing passwords. Commented Oct 16, 2020 at 4:07

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.