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!
Top comments (0)