search
HomeSystem TutorialMACHow to install SQL Server on Mac

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
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
How to reduce WindowServer Mac CPU usageHow to reduce WindowServer Mac CPU usageApr 16, 2025 pm 12:07 PM

macOS WindowServer: Understanding High CPU Usage and Solutions Have you noticed WindowServer consuming significant CPU resources on your Mac? This process is crucial for your Mac's graphical interface, rendering everything you see on screen. High C

The best snipping tool for your MacThe best snipping tool for your MacApr 16, 2025 am 11:57 AM

Screenshots are everywhere, yet we rarely think about their power to show, explain, and communicate. From reporting software bugs to sharing quick how-tos or funny images, screenshots enrich our daily interactions. While Windows users rely on the S

How to convert video and audio on Mac: Ultimate guideHow to convert video and audio on Mac: Ultimate guideApr 16, 2025 am 11:39 AM

There are many formats of audio files, which is dazzling. It's cumbersome to manage, and it can be very frustrating when you try to play audio but your favorite player cannot play a specific file due to the file type. This seems hopeless, but don't worry! You can usually convert audio and video files without losing quality. Here we will walk you through how to convert video to MP3, MP4 to MP3, and many other useful audio and video conversions. Easily convert video and audio Save time finding file conversion tools with professional media converter Permute. Free trial safe and reliable! How to convert video to audio For example, converting video to audio (such as MP4 to MP3) is not just a conversion video

How to Remove OneDrive from Mac? How to Uninstall It on Apple Laptop?How to Remove OneDrive from Mac? How to Uninstall It on Apple Laptop?Apr 16, 2025 am 11:02 AM

OneDrive for Mac: A Comprehensive Uninstall Guide OneDrive, Microsoft's cloud storage service, offers online file storage and synchronization across various platforms, including Mac. However, you might need to remove it for storage optimization, inc

Ways to use TikTok on MacWays to use TikTok on MacApr 16, 2025 am 10:57 AM

Spyware removal guide: How to get rid of spyware on Mac in secondsSpyware removal guide: How to get rid of spyware on Mac in secondsApr 16, 2025 am 10:56 AM

Mac computers are not absolutely safe: A practical guide to protecting against malware You may have heard that Mac computers are not infected with malware and do not need to buy antivirus software. Although it makes sense, this statement is misleading. Compared to Windows, Mac computers are indeed more secure, thanks to their operating system architecture. But that doesn't mean they are indestructible. All kinds of malware, from malicious scripts to viruses and spyware, still have a chance to hack into your Mac. Spyware is particularly worthy of attention because it can cause serious damage to your Mac and your personal information. Let's learn what spyware is and how to remove it from your Mac. What is spyware? Fundamentally, spyware is a malicious intention

Turn YouTube to GIF: 4 best tools to convert YouTube video to gifTurn YouTube to GIF: 4 best tools to convert YouTube video to gifApr 16, 2025 am 09:54 AM

GIF Animation Map Guide: Easily convert YouTube videos to GIFs GIF animations are the perfect way to capture moments, express emotions, or add fun to a conversation. But how to convert YouTube videos to GIFs? It used to feel like a brand new challenge, and I didn’t realize how simple it was until I experienced it myself. This guide will show you how to easily make your favorite YouTube videos into amazing GIF animations. Let's get started! Getting done with YouTube videos to GIFs easily in a few steps Gifox software can easily record the screen into GIF animations. Available on the Setapp platform. Free trial Security test My requirements steps to create YouTube videos as GIFs and install them

See all articles

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft