Table of Contents
Step 1. Install and config Docker
Step 2. Install SQL Server on Mac
Step 3. Install Azure Data Studio
How to check if SQL Server works properly
Tools for managing databases
Try tools for managing SQLdatabases for free
FAQ
Can you run SSMS on Mac?
How do I access an SQL Server database on Mac?
How do I check SQL database status?
How do I test an SQL database connection?
Home System Tutorial MAC How to install SQL Server on Mac

How to install SQL Server on Mac

Apr 12, 2025 am 09:08 AM

How to install SQL Server on Mac

Did you hear that installing SQL Server on macOS is tricky? That’s not entirely true. While it’s a bit more challenging than on Windows, it should take you no more than 15 minutes anyway. In this post, I’ll explain how to install and set up Microsoft SQL Server on your Mac, step by step, in a way that even a kid could follow.


Working with SQL on a Mac?

Try Base – a lightweight SQLite database manager with a spreadsheet-like interface. Now, you don't need to learn SQL commands. Available with your Setapp subscription.

Try free Security-tested

Step 1. Install and config Docker

Microsoft developed SQL Server for Windows, which means to run it on Mac, you’ll need an additional tool. Docker is just the software for the task as it provides an environment for your SQL Server to work in.

Here’s how to install Docker on your Mac.

  1. Download Docker from the official websiteand install it.
  2. Open Docker and agree to the terms. During the setup, you’ll need to install a helper tool, so your Mac will ask for your password to confirm the action.
  3. Sign up for the app. Here's what you'll see:

How to install SQL Server on Mac

Step 2. Install SQL Server on Mac

Now you are ready to download, set up, and run SQL Server on Mac.

  1. Open Terminal.
  2. Type docker pull mcr.microsoft.com/mssql/server:2022-latest and hit Enter. The command execution will take about 5 minutes to complete.

How to install SQL Server on Mac

3. Launch your downloaded SQL Server image in Docker. To do this, use the following command in Terminal, replacing the text in bold with your own data:docker run --name [your desired SQL Server name] -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=[password for your database]' -e 'MSSQL_PID=[your Docker membership type]’ -p 1433:1433 -d mcr.microsoft.com/mssql/server:2022-latest

Here is the command I used. The text in bold indicates where you should insert your information.

docker run --nameSQLServer-e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=12345OHdf%e'-e 'MSSQL_PID=Express-p1433:1433 -d mcr.microsoft.com/mssql/server:2022-latest

Note
  • ACCEPT_EULA=Y in the above command means you are accepting a user license agreement for Docker.
  • Your password needs to be at least 8 characters long and include uppercase and lowercase letters, numbers, and symbols.

SQL Server should be running on your machine now. To check, click the Docker icon in your menu bar and go to Dashboard. Here's my container:

How to install SQL Server on Mac

Step 3. Install Azure Data Studio

Now, you need to download and install Azure Data Studio. This tool is the Mac equivalent for SQL Server Management Studio (SSMS).

  1. Download Azure Data Studio from the official Microsoft websiteand open it.
  2. Click Create a connection and fill in the boxes.
  • Server — since SQL Server is running on your own Mac, the server here is just localhost.
  • Authentication type — SQL Login (choose it from the drop-down list).
  • User name — SA (for system admin).
  • Password — the one you’ve entered in the Terminal command to run SQL Server with Docker. That’s 12345OHdf%e in my example.

Here's what you should get:

How to install SQL Server on Mac

3. Press Connect.If you receive a connection error notification, press "Enable Trust Server Certificate."

If everything worked fine, your database is now ready for management:

How to install SQL Server on Mac

Read more:
  • Top alternatives to Notepad text editor for Mac
  • Zsh: Permission denied Terminal error


How to check if SQL Server works properly

If you are able to connect to your running SQL Server in Azure Data Studio, SQL Server should be fully operational.

To test it out, get a sample database from Microsoft and run a few queries. I’ve used theAdventureWorks2022.bak database that corresponds to my SQL Server version. Make sure to select the database version that coincides with your SQL Server version, in my example it’s mcr.microsoft.com/mssql/server:2022-latest, so I used AdventureWorks2022.bak OLTP data file.

How to install SQL Server on Mac

  1. Download the database file and move it to a new system folder for Docker to be able to access (you can also leave it in Downloads).
  2. Open the Terminal and access the file. If it is in the Downloads folder, move it there with thecd Downloads/ command.
  3. Create a new directory for your database file with sudo docker exec -it SQLServer mkdir var/opt/mssql/backup command.
  4. Move your database to the new directory with >sudo docker cp AdventureWorks2022.bak SQLServer:var/opt/mssql/backup command.
  5. Now, open Azure Data Studio and enable the Restore feature. For this, goto Azure Data Studio > Settings > Settings > Workbench, and choose Enable Preview Features.

How to install SQL Server on Mac

6. Return to localhost and click the arrow to expand the menu, and access the Databases folder (see the screenshot above).

7. Right-click on Databases and select Restore Database (Preview).

How to install SQL Server on Mac

8. In the window that appears from the "Restore from" drop-down menu, select Backup file.

9. Click on three dots next to "Backup file path" and from there navigate to:var/opt/mssql/backup/AdventureWorks2022.bak

How to install SQL Server on Mac

10. Confirm your choice and click Restore.

Now you are ready to test SQL database connection with a few test queries. To do that, just select your newly added sample database and click New Query.

How to install SQL Server on Mac

Read also:

  • SQL Server Management Studio Alternatives for Mac
  • Manage Multiple Databases With Tableplus
  • Dbms for Mac
  • Use Go With MySQL

Tools for managing databases

Now that you’ve completed your SQL Server setup, it’s time to think about managing your databases.

SQLPro Studio is one of the tools I can recommend. The app excels at all the database management basics that you need — create tables, make custom queries, use autocomplete, and more with this handy tool. SQLPro Studio is a native Mac app and supports multiple database types, including MySQL, PostgreSQL, Microsoft SQL Server, and others.

How to install SQL Server on Mac

TablePlus is another app that can help you manage SQL databases. This GUI tool will come in handy for your MySQL, Postgre, SQLite, and other databases. Lightweight and fast, it's super easy to use and makes your databases work lightning fast. Navigate your connected databases, edit data rows or table structure, and more with TablePlus.

How to install SQL Server on Mac

Baseis an easy app with a spreadsheet-like interface that simplifies SQLite file management and eliminatesthe need to learn complex SQL commands. Its core features include easy SQLite database creation, instant and consistent data filtering, basic import and detailed export options, smart autocomplete, and more.

How to install SQL Server on Mac

Try tools for managing SQLdatabases for free

As you see, installing SQL Server on your Mac is quick and easy, although it requires a virtualization tool, Docker. Since SSMS is not available for macOS, you’ll also need a replacement, which in our article was Azure Data Studio. The tool allows you to connect SQL Server engines to databases, even on macOS.

To manage and edit your databases, you can use specialized tools like SQLPro Studio or TablePlus. Both are available with your Setapp subscription, along with other tools for working with SQL databases, includingSQLPro for SQLiteandBasefor SQLite.

Try these and more tools for daily productivity onSetapp. Start your 7-day free Setapp trialnow!

FAQ

Can you run SSMS on Mac?

No, SQL Server Management Studio only runs on Windows. For macOS, Microsoft recommends using Azure Data Studio.

How do I access an SQL Server database on Mac?

In order to work with SQL databases on Mac, you need to use a virtualization tool like Docker, pull an SQL server image and run it, and then connect it to your Mac with a helper tool. You can do that with Azure Data Studio, or use other tools for the task. Run Azure Data Studio restore tool to add an existing database and check your SQL database connection with a few test queries.

How do I check SQL database status?

To check your SQL database status, you can use DATABASEPROPERTYEX function:

How to install SQL Server on Mac

How do I test an SQL database connection?

Get a sample database from Microsoft (e.g., AdventureWorks2022.bak) and run a few queries.

Subscribe to Setapp newsletter Get more handy Mac tips and app insights with the weekly newsletter.

The above is the detailed content of How to install SQL Server on Mac. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Spotify on Apple Watch: How to use it in 2025 Spotify on Apple Watch: How to use it in 2025 Apr 04, 2025 am 09:55 AM

With the support of Apple devices' interconnected ecosystem, managing and synchronizing your Apple devices has become a breeze. Unlock Mac with Apple Watch? Simple! (If you haven't set this unlocking method yet, you should really try it, it's very time-saving). Can you pay with Apple Watch without using iPhone? Apple can handle it easily! Today we will focus on how to download the Spotify playlist to an Apple Watch and play without an iPhone. Spoiler: This is possible. How to use Spotify on Apple Watch: A quick overview Let's dive into the key issues and their solutions directly. If this form helps you, that would be great! If you

Floating screen recording: how to capture a specific app window on a Mac Floating screen recording: how to capture a specific app window on a Mac Mar 28, 2025 am 09:16 AM

Mac Screen Recording: Easily capture windows, areas and drop-down menus The screenshot tool (Command Shift 5) that comes with Mac systems can record full screen or selected areas, but cannot record specific application windows separately. At this time, more powerful tools are needed to complete the task. This article will introduce several ways to help you record your Mac windows as easily as a professional. Record the application window separately Record a single window to avoid cluttered desktop backgrounds and create more professional and prominent images and videos. Here are some excellent screen recording applications: Function comparison Gifox CleanShot X Dropshare Record a specific window ✓ ✓ ✓

Email is not syncing? How to refresh the Mail app on Mac Email is not syncing? How to refresh the Mail app on Mac Apr 04, 2025 am 09:45 AM

Mac mail synchronization failed? Quick solution! Many Mac users rely on the included Mail app because it is simple and convenient. But even reliable software can have problems. One of the most common problems is that Mail cannot be synced, resulting in recent emails not being displayed. This article will guide you through email synchronization issues and provide some practical tips to prevent such issues. How to refresh the Mail app on your Mac Operation steps Click the envelope icon Open the Mail app > View > Show Tab Bar > Click the Envelope icon to refresh. Use shortcut keys or menu options Press Shift Command N. Or open the Mail app

How to get rid of 'Your screen is being observed' error How to get rid of 'Your screen is being observed' error Apr 05, 2025 am 10:19 AM

When you see the message "Your screen is being monitored", the first thing you think of is someone hacking into your computer. But that's not always the case. Let's try to find out if there are any issues that need you to worry about. Protect your Mac With Setapp, you don't need to worry about choosing a tool to protect your computer. You can quickly form your own suite of privacy and security software on Setapp. Free Trial Security Test What does "Your screen is being monitored" mean? There are many reasons why there is a Mac lock screen message that appears with “Your screen is being monitored”. You are sharing the screen with others You are recording the screen You are using AirPlay You are using some apps that try to access your screen Your computer is infected with evil

How to show only active apps in Dock on Mac How to show only active apps in Dock on Mac Apr 09, 2025 am 11:44 AM

Mac Dockbar Optimization Guide: Show only running applications The dock bar of your Mac is the core of the system, from which you can launch Finder, Trash, recently used apps, active apps, and bookmark apps, and even add folders such as Document and Downloads. By default, the Mac dock bar will display more than a dozen Apple-owned applications. Most users will add more applications, but rarely delete any applications, resulting in the dock bar being cluttered and difficult to use effectively. This article will introduce several ways to help you organize and clean up your Mac dock bar in just a few minutes. Method 1: Manually organize the dock bar You can manually remove unused applications and keep only commonly used applications. Remove the application: Right-click on the application

How to uninstall Honey from Mac How to uninstall Honey from Mac Apr 04, 2025 am 10:13 AM

See all articles