Adding here for reference (tried this in Mac OS X Mojave):
# To set an environment variable, enter the following command:
launchctl setenv variable "value"
# To find out if an environment variable is set, use the following command:
launchctl getenv variable
# To clear an environment variable, use the following command:
launchctl unsetenv variable
In case you need to run SQL Server scripts from your Mac, do the following to install (NOTE: I use HomeBrew.):
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
ACCEPT_EULA=y brew install --no-sandbox msodbcsql mssql-tools
- You should see something like in the screenshot. Type “YES” if prompted and be on your way.
- Once done, type:
In case you’re looking for a SQL client that is cross-platform, lightweight, and free SQL client, check out:
I use it on a Mac. It’s easy to use and feels “new.”