Microsoft SQL Server is a relational database management system developed by Microsoft.
MSSQL Server can be accessed using the Microsoft ODBC Driver 17 for SQL Server driver available as tap for Homebrew:
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
brew install --no-sandbox msodbcsql17 mssql-tools
Edit the located odbcinst.ini (eg. /usr/local/etc/odbcinst.ini
) and append:
[Driver_MSSQL_Server2017]
Description = Microsoft ODBC Driver 17 for SQL Server
Driver = /usr/local/lib/libmsodbcsql.17.dylib
Setup =
UsageCount = 1
You can either use the system odbc.ini or user .odbc.ini file. As example edit your user file ~/.odbc.ini
and append:
[DSN_MSSQL_Server2017]
Description = Test Server MSSQL_Server2017
Driver = Driver_MSSQL_Server2017
Server = 127.0.0.1
UID = sa
PWD = yourStrong(!)Password
Microsoft provides official images for Microsoft SQL Server on Linux for Docker Engine. For detailed description about possible environment variables please read this docker image description.
Host : localhost
Port : 1433
User : sa
Password: yourStrong(!)Password
docker pull microsoft/mssql-server-linux:2017-latest
docker create -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=yourStrong(!)Password' -e 'MSSQL_PID=Developer' -e 'no_proxy=*.local, 169.254/16' -p 1433:1433 --name test-server-mssql microsoft/mssql-server-linux:2017-latest
The Container was created and named test-server-mssql.
docker start test-server-mssql
docker stop test-server-mssql
docker rm test-server-mssql
unixODBC comes along with a command line tool to interact with DBMS via ODBC DSN. You can run it using the DNS and Server parameter shown above:
isql DSN_MSSQL_Server2017 sa 'yourStrong(!)Password'
You should get on success case:
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>