Hi friends!
So, I recently kicked off a pretty cool 90-Day MVP project and guess what? I bumped into a bit of a snag â I needed to get SQL Server up and running on my Mac. Now, if youâve ever tried this, you know itâs not the most straightforward task. SQL Server and Macs donât usually play nice together, right? But donât worry, Iâve got you covered. In this blog post, Iâm going to walk you through the whole process, step by step.
Step 1: Install & Configure Docker
First things first: You need to install Docker. Hereâs an article to help you do it.
Alright, before we jump into installing SQL Server using Docker, hereâs a quick but important step â we need to give Docker a bit more memory to work with. Hereâs how you do it: First, click on that little Preferences gear icon in the top right corner of your Docker app. Once youâre there, head over to the Resources tab. Youâll see a Memory slider â itâs usually set at 2 GB by default. Letâs bump that up to 4 GB.
Just slide that little guy over to the right. Done? Great! Now hit Apply & Restart. Thatâs it, Docker now has more room to breathe, and weâre all set for a smoother installation.
Step 2: Install & Setup SQL Server
Ok, folks, itâs go time! Weâre now ready to download, set up, and get SQL Server running on your Mac. Hereâs the game plan:
First things first, letâs open Terminal.
Once your Terminal window is up, youâre going to type in this command (itâs a bit of a mouthful, but youâve got this!):
docker pull mcr.microsoft.com/mssql/server:2022-latest
Hit Enter, and the download will kick off. Just hang tight for a bit.
After the download wraps up, itâs time to fire up your brand-new SQL Server image in Docker. Hereâs the magic command you need:
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=strongestPasswordEver123%'-p 1433:1433 -d mcr.microsoft.com/mssql/server:2022-latest
A quick note: by typing ACCEPT_EULA=Y
, youâre giving a thumbs-up to Dockerâs end user license agreement.
And voilĂ , SQL Server should be humming along on your machine. To double-check, click the Docker icon in your menu bar and peek at the Dashboard.
Step 3: Install Azure Data Studio & Connect to Your SQL Server Instance
Next up: You need Azure Data Studio. Think of it as the Macâs answer to SQL Server Management Studio (SSMS). Download it, then drag and drop the Azure Data Studio icon from Downloads to Applications in Finder.
Open Azure Data Studio and hit âNew connectionâ. Since SQL Server is running on your Mac, just type localhost
for the server. Your username is sa
(thatâs short for system admin), and the password is what you used in the Terminal command. In our little example here, thatâs strongestPasswordEver123%
.
And there you have it! Youâre all set to rock and roll with SQL Server on your Mac.
Also, just a heads up â even though weâre all about getting Microsoft SQL Server up and running on macOS in this tutorial, thereâs no reason you canât use these same tricks for Docker on Windows or Linux. Itâs pretty versatile like that!
And hey, if any of you out there are wizards at cross-platform development with .NET and have some cool tips or sneaky tricks up your sleeve, Iâm all ears. Sharing is caring, right? Letâs make this .NET development journey easier for everyone!