Sql Server For Mac
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.
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 .”
SQLPro for MSSQL is the Premier application for editing and viewing SQL Server databases on mac os x. Jun 29, 2018 Unfortunately, Microsoft didn’t make SQL Server Platform-Independent. Instead, Microsoft announced SQL Server 2017 for Linux. Seeing the features and benefits of Docker, Microsoft released the Docker image of “SQL Server 2017 Linux”. With the help of Docker, we can easily run Sql Server and connect our.Net application to it on our Mac. SQLPro Studio is the Premier application for editing and viewing mysql, postgres, oracle and microsoft sql server databases on mac os x.
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'}'>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.
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
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.
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.
When I graduated from college, one of the first computers I ever used was a MacIntosh. I loved the Mac, the user interface, and the overall footprint of that computer. I also started my career developing on UNIX systems with C++ and databases like Ingres. As I moved to other jobs, the PC was becoming very popular as was the Windows Operating System. When I joined Microsoft in 1993, I would embark on a 25 year journey working only on Windows laptops and Windows Server computers.
Last October we released SQL Server 2017 including support for Linux and Docker Containers. Since then, I have spent a great deal of my time talking to customers directly and at events about SQL Server on Linux. At one of these events in February in London (you may have heard of SQLBits), I was presenting on SQL Server on Linux and someone in the audience asked me this question. 'Bob, I love what Microsoft is doing with Linux but I'm a MacBook user. I want to use my MacBook and run SQL Server on it'. I thought for a second on this question and then came up with the idea of the 'SQL Server Mac Challenge'. I told the audience that with a reasonable internet connection, I could get any MacBook user up and running and connected to SQL Server with no Windows or Virtualization software in 5 minutes or less. The person in the audience took me up on my challenge and posted something on Twitter the next day that it worked!
Given my work lately on SQL Server on Linux, I asked my manager if I could get a MacBook so I could show off SQL Server to the MacBook user community. His answer was 'of course!' Perhaps you are reading this and think this must be the Twilight Zone. Does this guy still work for Microsoft?
So here in this blog post, I will show you my journey in taking the SQL Server Mac Challenge. I'm happy to tell you it took only 4 minutes on my MacBook Pro.
First, you need to download Docker for Mac as seen on this screenshot of the website to download (https://store.docker.com/editions/community/docker-ce-desktop-mac)
The download is not too large and didn't take long on my internet connection. At the bottom right corner on my MacBook is an icon for downloads. I selected this to extract the downloaded image
When the image for Docker for Mac is extracted, a new window pops up so I can install it as an Application. I just used my mouse to drag the Docker icon on the Applications icon on this screen
When this completed, I selected the Launchpad application on the Dock and it shows the Docker application installed
I double-clicked the Docker Application. Now I see a new icon at the top status bar on my MacBook showing Docker is starting up
While Docker is starting up, I now decided to multi-task and download our new open-source, cross-platform tool called SQL Operations Studio. You can download the Mac version at https://docs.microsoft.com/en-us/sql/sql-operations-studio/download?view=sql-server-2017.
While SQL Operations Studio is downloading, I can pull the docker image for SQL Server. The steps for pulling docker images for SQL Server can be found at https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-linux-2017. Since the terminal for MacBook is a bash shell, I just ran this command in the terminal
Here is my terminal screen showing the docker pull in action
Teams for mac. If Teams is already installed, you're all set!. Download to your Mac to use the instant messaging and online audio/video meetings tool.Use the Spotlight Search to confirm that you don't have Teams installed on your Mac.
While the docker pull is now downloading the docker image for SQL Server, I went back to extract the SQL Operations Studio download.
If you look closely at this screen, the docker pull has completed so now I can start up a docker container with these commands:
Notice the -p parameter which maps port 1433 to 1401. When I connect to this SQL Server I will use port 1401.
The result of this command looks like this. When this completes SQL Server is now up and running in a Docker container. Docker on Mac is a native Mac application.
Note: There is an issue with Docker on Mac and SQL Server using Host Volume Mapping. You can use data volume containers instead. See this note at https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-configure-docker?view=sql-server-linux-2017#persist and the github issue at https://github.com/Microsoft/mssql-docker/issues/12.
SQL Operations Studio has extracted so I'll select that to install it as an application and launch it. Again, SQL Operations Studio for Mac is a native Mac Application.
When SQL Operations Studio launches it pops-up a window for me to supply a server to connect to. I'll use the local IP address, port 1401, and the sa password I supplied when running the container
When I connect, SQL Operations Studio shows an Object Explorer and dashboard
I run a query by right-clicking the Server and select New Query
Microsoft Sql Server For Mac Download
And now I'll run SELECT @@version to prove I can run a query
There you have it. I did this in less than 5 minutes!
So calling all MacBook users. Take the SQL Server Mac Challenge!
Bob Ward
Microsoft Sql Server For Mac
Microsoft