Never did I think that I'd be able to run SQL Server on my Mac. My, how times have changed. For the first time, SQL Server 2017 allows users to install the product on Linux. This opens the doors for working with fully-featured SQL Server database engines on MacOS through freely distributable Docker containers. All programmers need to learn SQL sooner or later: the SQL programming language is the backbone of most apps, businesses, and websites. Here's how to get started coding with SQL on the Mac. You can use TablePlus as an alternative to manage SQL Server db: It’s native for macOS It supports SQL Server, along with a handful of other drivers such as MySQL, PostgreSQL, SQLite, Oracle.
In a previous post, I wrote about setting up SQL Server 2019 via Docker container on Windows 10. Microsoft has championed the fact that they support more than just Windows. I decided to put that to the test and try running SQL Server 2019 on on Mac OS X using Docker. I figure Docker is Docker on pretty much everywhere it’s running, so this should be a piece of cake.
Assumption - Docker is already running on your Windows 10 computer. I’m making this assumption to avoid walking through install and setup of Docker on Mac OS X.
Mouse for mac. Step 1. Download the Software
Downloading the software works the same as it does on Windows or any other platform. At the time of this writing, the container label is “vNext-CTP2.0-ubuntu“ and it can be found on docker hub at “docker pull mcr.microsoft.com/mssql/server .”
The full pull command looks like this:
n','url':'https://youtu.be/UuR-7sCoscU','width':854,'height':480,'providerName':'YouTube','thumbnailUrl':'https://i.ytimg.com/vi/UuR-7sCoscU/hqdefault.jpg','resolvedBy':'youtube'}'>Pull of the latest SQL Server 2019 docker container on Mac OS X
Step 2. Run the Downloaded Container
Running the container is next. When the SQL Server container is run, the End User License Agreement (EULA) must be accepted and a password set for the container to execute. For the purpose of this demo, I’ll use a simple password of “Password1234'.” Such a simple password is not recommended for production.
Screen time for mac. The port for accessing the SQL Server instance in the container must also be set. Changing the port is useful for a number of reasons, The most useful one I’ve found is running multiple SQL Server containers on the same host. In this example, I’ll keep the port at the default of 1433.
The command to run the container is
Docker Run command for SQL Server 2019 on Mac OS X','raw':false},'hSize':null,'floatDir':null,'html':'','url':'https://youtu.be/UN06ockIwr4','width':854,'height':480,'providerName':'YouTube','thumbnailUrl':'https://i.ytimg.com/vi/UN06ockIwr4/hqdefault.jpg','resolvedBy':'youtube'}'>Docker Run command for SQL Server 2019 on Mac OS X Hotspot shield for mac.
The running state of the container can be checked by issuing the command
The SQL Server is available for connections once the state is confirmed as running.
Step 3. Connect to SQL Server
Microsoft recently renamed the SQL Operations Studio as Azure Data Studio. Azure Data Studio is available on Windows, Mac, and Linux. The connection will be made using the local sa account and the password supplied when running the container.
','url':'https://youtu.be/RS4YcYOAO4Y','width':640,'height':480,'providerName':'YouTube','thumbnailUrl':'https://i.ytimg.com/vi/RS4YcYOAO4Y/hqdefault.jpg','resolvedBy':'youtube'}'>
Connecting to SQL Server 2019 Docker Container on Mac OS X using Azure Data Studio
That’s it! The container works and functions the same as any other SQL Server would behave. Containerized instances are simple to setup and allow for testing and experimentation on platforms that were previously off limits.