Starting with SQL Server 2017, you can now install SQL Server directly on to a Linux machine. And because macOS is Unix based (and Linux is Unix based), you can run SQL Server for Linux on your Mac. The way to do this is to run SQL Server on Docker.
Sql Server 2017 Download For Mac
Microsoft has made SQL Server available for macOS and Linux systems. This is made possible by running SQL Server from a Docker container. Therefore, there's no need to install a virtual machine with Windows (which was the only way to run SQL Server on a Mac prior to SQL Server 2017).
This is a prerequisite for installing SQL Server on your Mac. Because the Mac runs SQL Server inside a Docker container, the first thing we need to do is download and install Docker (unless it's already installed). Once installed, we'll increase its memory allocation to a more suitable level for running SQL Server.
* The exact command will depend on which release you download. Also, since I wrote this article, Docker has moved the repository for SQL Server. You might need to use docker pull mcr.microsoft.com/mssql/server:2017-latest-ubuntu to download SQL Server 2017.
If you are accessing this page from a non-English language version and want to see the most up-to-date content, please select Read in English at the top of this page. You can download different languages from the US-English version site by selecting available languages.
1. Download the Docker Community Edition installation file from the official Docker download page. Depending on your hardware, select the appropriate link in the Get Docker Desktop for Mac section to start the download.
Note: The MSSQL server currently supports only Intel-based Macs. If you want to use SQL on a Mac featuring an ARM-based Apple chip, skip this section and read how to install the SQL alternative for ARM-based Macs.
Since the SQL server Docker image supports only amd64 architecture, attempting to run it on an ARM-based Mac machine results in error. However, Azure SQL Edge, a similar RDBM tool primarily designed for IoT edge deployments, can be used as a fully functional alternative.
SQL Server Management Studio (SSMS) is a free integrated tool that allows you to access, configure, manage and administer all components of the SQL server, Azure SQL Database, Azure SQL Managed Instance and Azure Synapse Analytics.
Once we run the above command, Docker will start extracting the image from the web and downloading the same into your local machine. The Docker image will become visible in the docket desktop window, as shown in the below image.
Once you complete your work, you can save your progress and quit the workspace. Enter the mssql prompt [press ctrl+c] and stop the running Docker container using the docker stop command. If you want to re-open it, restart the existing docker container and start the SQL server via the terminal giving your username and password.
If Visual Studio 2019 is already installed, you can edit the list of workloads to include SSDT. If you don't have Visual Studio 2019 installed, then you can download and install Visual Studio 2019 Community.
In this quickstart, you'll use Docker to pull and run the SQL Server 2017 (14.x) Linux container image, mssql-server-linux. Then you can connect with sqlcmd to create your first database and run queries.
This quickstart creates SQL Server 2017 (14.x) containers. If you prefer to create Linux containers for different versions of SQL Server, see the SQL Server 2019 (15.x) or SQL Server 2022 (16.x) versions of this article.
In this quickstart, you'll use Docker to pull and run the SQL Server 2019 (15.x) Linux container image, mssql-server-linux. Then you can connect with sqlcmd to create your first database and run queries.
This quickstart creates SQL Server 2019 (15.x) containers. If you prefer to create Linux containers for different versions of SQL Server, see the SQL Server 2017 (14.x) or SQL Server 2022 (16.x) versions of this article.
In this quickstart, you'll use Docker to pull and run the SQL Server 2022 (16.x) Linux container image, mssql-server-linux. Then you can connect with sqlcmd to create your first database and run queries.
This quickstart creates SQL Server 2022 (16.x) containers. If you prefer to create Linux containers for different versions of SQL Server, see the SQL Server 2017 (14.x) or SQL Server 2019 (15.x) versions of this article.
The previous command pulls the latest SQL Server 2017 (14.x) Linux container image. If you want to pull a specific image, you add a colon and the tag name, such as mcr.microsoft.com/mssql/server:2017-GA-ubuntu. To see all available images, see the mssql-server Docker hub page.
If the STATUS column shows a status of Up, then SQL Server is running in the container and listening on the port specified in the PORTS column. If the STATUS column for your SQL Server container shows Exited, see the Troubleshooting section of the configuration guide. The server is ready for connections once the SQL Server error logs display the message: SQL Server is now ready for client connections. This is an informational message; no user action is required. You can review the SQL Server error log inside the container using the command:
The previous command pulls the latest SQL Server 2019 (15.x) Linux container image. If you want to pull a specific image, you add a colon and the tag name, such as mcr.microsoft.com/mssql/server:2019-GA-ubuntu. To see all available images, see the mssql-server Docker hub page.
The previous command pulls the latest SQL Server 2022 (16.x) Linux container image. If you want to pull a specific image, you add a colon and the tag name, such as mcr.microsoft.com/mssql/server:2022-GA-ubuntu. To see all available images, see the mssql-server Docker hub page.
MySQL Cluster Community Edition is available as a separate download. The reason for this change is so that MySQL Cluster can provide more frequent updates and support using the latest sources of MySQL Cluster Carrier Grade Edition.
Check your localhost, 1443. It should generated a Database named AdventureWorks2017 and have contents such as Tables and Views. If not, right-click on localhost, 1443 and choose Refresh. You can also restart your Azure Data Studio application.
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. And then in 2017 we launched SQL Server on Linux, which includes support for containers.
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.
While Azure Data Studio is downloading, I can pull the docker image for SQL Server. The steps for pulling docker images for SQL Server can be found Since the terminal for MacBook is a bash shell, I just ran this command in the terminal
When Azure Data 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, Azure Data Studio shows an Object Explorer and dashboard. I run a query by right-clicking the Server and select New Query. And now I'll run SELECT @@version to prove I can run a query
Previously, Microsoft supported SQL Server to be installed only on Windows Machines, however, starting from SQL Server 2017, Microsoft has started to distribute the software for Linux machines as well. You can now install SQL Server on Linux distributions like the RHEL, SUSE, Ubuntu, etc. However, in order to install and use SQL Server on a Mac, you need to run the Linux distribution inside a docker container. This requires the SQL Server Docker image to be downloaded and installed on the local computer before using it. In this article, we will get started by installing Docker on MacOS first, and then use the SQL Server Docker image from the DockerHub and connect to it using Azure Data Studio. 2ff7e9595c
Comments