Run Microsoft SQL Server on a Mac (M1/M2)
ฝัง
- เผยแพร่เมื่อ 8 ก.ค. 2024
- SQL Server is a very popular RDMS, but running it on a Mac hasn't been possible - until now!
In this tutorial, we'll show you how to run Microsoft SQL Server on a Mac (M1/M2). This guide will help you get started with Microsoft SQL Server and provide some tips and advice on how to run the software on a Mac.
If you're looking to move your SQL Server data to a Mac or set up your Mac to study data then this video is for you. We'll show you how to install and set up Microsoft SQL Server on a Mac, and then we'll teach you how to run SQL Server Management Studio in a VM to connect to the Database Engine. By the end of this video, you'll be able to run Microsoft SQL Server on a Mac.
You can get Parallels here:
prf.hn/click/camref:1101lumT6
Get a copy of Parallels here: (affiliate link)
prf.hn/l/Y3zodAR
Install Docker for Mac silicon here:
docs.docker.com/desktop/insta...
Install SQL Server on Mac (after installing Docker) here:
kb.parallels.com/en/129699
AI to help with e-mail overwhelm: try.sanebox.com/wgme43jv1x6y
Would you like to learn Microsoft Whiteboard?
I've launched a course on Microsoft Whiteboard! Over 2 hours of tips, tricks, and skills. This course is designed to make you a Whiteboard Wizard!
To celebrate the launch, there is a 30% Discount if you use the code Launch30 at checkout. It's limited to only 50 enrollments, so you'll hurry if you want the discount.
frank-s-site-a22b.thinkific.c...
My Favourite Gear
Here is my Amazon Store - I try to keep it updated 😁
Canada www.amazon.ca/shop/learningan...
US Store www.amazon.com/shop/learninga...
Social Links
📸 Instagram - / learning_and_tech
🧑🤝🧑 Facebook - / learningtechnologychannel
🐤 Twitter - / frankbergdoll
🌏 BLOG (Franks Class) - www.franksclass.ca
🌐 Learning Mindset Website - learningmindset.ca
Some links may support this channel via affiliate programs
#SQL #Mac #SSMS #data - วิทยาศาสตร์และเทคโนโลยี
When I go to "features in development", there is no " Use Rosetta ..." box that I can click on. What might be causing the issue?
I’ll have to double-check. A few folks have mentioned this and I’m wondering if it’s now out of development and just part of Docker.
@@LearningandTechnology facing same issue
found it, its now under General in settings
@@imxd1698Fantastic! Thanks - I’ll pin this comment to make sure every knows
How did you find it? @@imxd1698
Oh. My. Gosh. Thank you!!! I have been trying to set this up all. day. I have literally spent HOURS reading forums and watching videos on how to do this, but the IP address info was THE missing piece. Thanks a MILLION!
My IP address won't connect for some reason
I got it:)
2 days of struggling and finally your solution worked. Thank you very much
Much appreciated because this is just what I needed. Clear and helpfull.
1 month of struggling and finally your solution worked. Thank you very much
When I connect visual studio code to sql server I get the error "the type initializer for microsoft.data.sqlclient.tdsparser threw an exception" can you help me?
I just set this up on my MacBook Air M2 and it works great, super excited! Docker now has the Rosetta setting in 'General' and everything worked perfectly. Also I'm running Parallels 18 with Windows 11 and it worked great. Thank you so much for this tutorial super happy!
can you use visual studio code 2022 and work with the data bases from the docker sql? thank u sm!!
@@giann411 yes absolutely got docker working with sql server
Thank you very much After days of Struggling I managed to install
Thank You. I used to search for resolution for a long time.
Thank you so much for such a clear explanation! I've finally installed it on my Mac M1, and it turned out to be so easy 🙏
This makes me very happy
This man is straight spittin. Very well done.
Brilliant! I could finally set-up this bad boy! I appreciate you so much Frank!
Excellent! Thank you for watching and commenting - have fun with data!
Thank you! This really helped me. I was wondering why I couldn't connect to localhost with my VM when I could through the Mac app. Instead I put my IP address in Azure and it connected instantly.
Great tutorial! Thank you very much! I'm able to use SQL on my Macbook now :)
Hello, can you help me? I try to restore a database using SSMS, but only the container directories appear, I tried to import the database into the container but it doesn't work
This is really helpful, thanks a million
Thanks a lot for your help. It worked for me.
very helpfull...thanks a lot sir
you're the man Frank! Thanks a billion!
Thank you very much!!! It is really very useful, thank you for your work and video)
Is full-text available for this sql instance?
Great video! How can we set this up as a local host instead of using the IP? I find when I switch networks I am having to switch some settings to keep the connections going.
Thank you so much krub 😚
Extremly usefull, thank you very much!!
Glad it helped! Thank you for commenting too! Appreciate it!
IT WORKED! OMG I've been struggling all day thank you
Hooray!
@@LearningandTechnology Your video along with "How to Restore a SQL Server Database on macOS Using Docker by Chritian Hur" really saved me a huge amount! thank you so much. If anyone is looking to load the AdventureWorks.bak file onto docker and use it via parallels on Mac please follow this.
thank you soooo much! it works!)
Hello, pls I have a very urgent question. Can something like this help me install a “Microsoft 2019 sever on my M1 Mac”
Thank you so much
Is their anyway to run windows 11 and install RSAT tools for administrators?
Thanks Frank! Does this mean that the database we create is housed on our mac computers and not on the azure cloud services? What about backups or security with what we create? Thanks!
Yes indeed! The Database is on the Mac and local. So you need to handle admin tasks such as back-up, access, high availability and such.
For this reason, I do try to use Cloud Services - bit this is a good option for testing and learning or in cases where the Cloud is not an option.
thanks for sharing this video, very grateful. one more question, do you know how to insert the data form Excel in to the database in Microsoft SQL. what is the right format for the file path ? thank. you so much.
I often have students use the Import/Export wizard for simple Excel (csv) files to SQL
That would be a good video…
Thanks !
Thanks is much for your help on this! Lifesaver! When I shutdown Docker Mac or Windows 11 on Parallels, why does the SQL container go away afterwards? I have to go back to your link recopy the code into terminal and run the whole process again
It should be persistent and remain in place until deleted. There should be a way to save when you shutdown?
Glad it was helpful!
Life saver for Mac users!!! Appraciated!!
You're welcome! Thank you very much for watching and taking the time to comment as well - it really helps the channel.
I'm glad it was useful!
Of course my pleasure Frank! I watched tons of them but got errors with Macbook Air M2, 2022. Finally found your video and works perfectly! Thank you again Sir! @@LearningandTechnology
Does it work in m3?
Hello. Thank you for this video. Please let me know if you can help me troubleshoot something: When I run the "docker run -e.." command in the terminal it just hangs. I've tried several times and waited several hours. It hangs and no new Containers ever appear in the Containers tab in Docker.
thank you so much!!!
Thank you!!
Hi Frank, I am not seeing the Rosetta feature. I have an intel chip so I downloaded the intel chip docker. Any suggestions on what to do? Thanks!
If it's an Intel chip, then you don't actually need Docker - you can just create a Virtual Machine and install SQL.
Thank you sooooo much!!!!!
Hey! Amazing video, SQL server works great! Even though my Mac is only 8gb of ram and it's a M1 chip. What do you of installing the Microsoft VS? Since it will be out of support for the macOS devices? Or is better to use another platform like Rider? Thanks!
Worked for me using it for school. I'll update if it doesn't work out.
I have a question. The Windows 11 that we install inside parallel is ARM version. But SQL Server Management Studio does not come with Arm version, how did you install SQL Server Management Studio inside windows which is ARM Version?
That is an issue. You need to run the container for SQL. For a lot of applications, we will run the databases in a Cloud service rather than local - or even different databases.
I wonder which Parallels Desktop edition is required to run the SQL Server Management Studio (SSMS) on Apple Silicon. Standard? Pro? Or the App Store one? Looking at the MS download site I find under supported hardware: "1.8 GHz or faster x86 (Intel, AMD) processor. Dual-core or better recommended". No mention of Windows ARM at all?
SSMS will run on a Windows 11 VM. In the video, I’m using the ARM version.
However, if you want to save a step, you can run Azure Data Studio to connect to the SQL Server - Data Studio has a version that runs on Macs.
Thanks for the tutorial, everything's working fine now.
I'm wondering if there is a way to use a generic IP address. Since the VM on Parallels run under the host of the MacBook directly, this will be very neat since it would allow me to have the same connection string every time and it won't be dependent of the network I use. I work with developers and our codebase is the same for everyone, we all have the web.config inside a .NET project and the host is like .\SQLEXPRESS and I don't wan't to change it every time. Any idea ?
I’d have to try it out, but the “old school” guy in me wonders if a quick edit of the HOSTS file might solve this.
I’m going to play around with this at some point - it should be possible one way or another other.
(Although - editing everyone’s HOSTS file is very 1980’s) 😀
@LearningandTechnology Hi Frank, I have downloaded the docker sor apple silicon chip and I have x86 running in parallels but the option to enable it on docker does not appear for me. Is there something I can do to solve this? I am using a MacBook with an M1 chip. Thanks
i have the same problem, if you have already solved it can you help me?
i aslo have a same problem @@mrmrhmi3947
Hello Frank, I am not seeing the Rosetta feature too. I have a m1 chip .Any suggestions on what to do?
Hey! It is on the general settings and already selected. Go ahead, it should work!
Hi Frank, I have a parallels 19. Can you you explain how can I install sql server, please.
SQL requires a x86 architecture - and Parallels has an Ubuntu x86 VM that you “could” use.
Here’s an easy way though:
Run Microsoft SQL Server on a Mac (M1/M2)
th-cam.com/video/co6TkSzc0s8/w-d-xo.html
I got this error in Terminal : ///: Any help?
docker: Error response from daemon: received unexpected HTTP status: 503 Service Unavailable.
See 'docker run --help'.
Hi Frank, This is working very well. Mac Mini M2, 24GB, 1TB. Now I am able to import XLSX directly into the SQL Server DB. I get the option to save the SSIS package, but I am curious as to which way to go to use SSIS to rerun the SSIS packages.. Do you have a learning for that?
I don’t have any SSIS content here on TH-cam - at least not quite yet :)
Hi, can we use SSRS on an M2 Mac using Parallels? Thanks!
Unfortunately not. The SQL products are all Intel-based (SSRS, SSIS, SSAS, SSMS). The Parallels on an M1/2 chip set runs an ARM based version of Windows 11. This is also why we cannot install Windows Server into a VM on M1/2 chips.
There are several options though (and I have videos here on most). We can run Cloud DB services on Azure (which is really the way things are going). We can run the install I show in this video - or we can run Infrastructure in the Cloud, build a VM, etc.
Could have just used a docker vm for sql, azure data studio for your manager? i understand azure data studio is not a full blown sql manager, but i think it's pretty good
Azure Data Studio would definitely work. In the video, I wanted to show the Windows VM so that if there are any Windows-only tools you need you can see how they can be used.
i can t connect to a local server on my mac?
Hi. Does it still work if im connected to new wifi network or would i have to copy a new IP address for every wifi network i connect to? And does it also work with visual Studio
Frank, just had a first view of this and will try this method. I have no prior knowledge with Docker. Once installed can I copy a .bak file to Docker and restore a Db from this .bak file? Doing a backup of a Db in the Docker container SQL using SSMS on the Windows11 on Parallels: 1) is that possible 2) where is the .bak file stored? Thanks! This looks promising. I wonder if there will ever by a SQL version that can run natively on ARM architecture...
The way to get the .bak file onto the database is to first set it all up as in the video - then, connect to it via SSMS and use SSMS (or Azure Data Studio) to restore the .bak file - then, "voila!" you will have your database.
@@LearningandTechnology Thanks, understood. What I am struggling with is how to define a particular folder in the macos file sytem as a volume in docker; and then how to refer to that volume when creating the image with a volume attached for data persistence as per the docker command that you linked to. Perhaps a separate video on that would help many novices like me. We are basically following a few instructions in order for the docker magic' to start working - really what's behind a docker image and its container is a nightmare to immediately understand.
@@borgehansen6680 Docker certainly has a lot more to it that would make some good videos! It’s a skill set that will become even more important in the future - so maybe some more videos would be a good idea. Thanks!
Hello Mr. Frank, I have a MacBook that runs on an Intel processor. Should I apply the same instruction as you did, or is there another way?
The Intel Macs are much easier! You can install Windows Server and SQL in a VM. They are x86 (Intel) programs.
@@LearningandTechnology Thanks for the reply Mr. Frank This means I have to download the Windows environment and download Sql Right inside it, right?
Thank you so much! I have additional questions, could you help me please? Can I run Visual Studio via Docker on M2? Can I run SSMS also via Docker? Thanks!
Yes - you can run different VMs via docker. I tend to use Parallels (there’s a link in the description for a discount)
Parallels is a nice hypervisor that has some features I really like.
I have some videos on that too! 😀
@@LearningandTechnology I already have a Parallels. It’s cool tool. My Visual Code is there. But I decided that it’s better to use Visual Studio, SQL Server and SSMS via one place - Docker. Does it make a sense or not? Thanks for answering)
@@soofiishaa ah! Yes - you can install them in a single Docker
Hi there, is there any way that I could do this but change the IP address to a static one instead of one that is dynamic?
That should be possible if you change the script. An easier way would be to create a DHCP reservation and then it will assign the same IP every time.
Hello Mr. Frank
i have problem when i try to connect my sql server to my application via entity framework please check if it works with you
and thanks ...
Microsoft.Data.SqlClient.SqlException: 'Login failed. The login is from an untrusted domain and cannot be used with Integrated authentication.'
You are the best, mssql running. but How can I restore or attach an existent database?
Once installed - you can connect using a client tool (SSMS, Data studio, etc) and restore that way.
Hi Frank. When I try to connect to Docker contained SQL Server, I have a error message:
"Cannot connect to (IP Address)
Additional Information
The type initializer for 'Microsoft.Data.SqlClient.TdsParser' threw an exception
(Microsoft.Data.SqlClient)
The type initializer for 'Microsoft.Data.SqlClient.SNILoadHandle' threw an exception
(Microsoft.Data.SqlClient)
Unable to load DLL 'Microsoft.Data.SqlClient.SNI.x86.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
What can I've missed?
how did you get the virtual window 11 tab?
its using parallels, but you need to pay subscription for it
Thank you very much, in fact you can use the IDE for Mac Azure Data Studio without having to use Parallels, but for those who prefer the Windows IDE it is excellent. On the other hand, if you can show how to connect this database with R Studio it would be very helpful to me. Thanks again.
Good point - Azure Data Studio runs across a lot of platforms.
I have some "R" videos on my roadmap - hopefully soon. My problem is that I'm interested in too many technologies :) haha! One video at a time!
I understand you, but please let me know when you do it.@@LearningandTechnology
or we can control the docker sql server on mac through azure data studio for mac so it eliminates the need for parallels
Using SSMS was meant as an example - I wanted to demonstrate the use of Windows-only tools. There are several options - including remote access from a different system entirely, etc.
Oh - and the other element was to support older tools for Business Intelligence that won’t work with Azure Data Studio. That’s a whole other set of work.
Hello Frank I have the m1 chip macbook pro and upon downloading the docker, i don't see the rosetta option in features in development
It may be possible that it’s no longer in development and now part of the install. Does the rest of the install work?
@@LearningandTechnology after the terminal step, I don’t see the application in the container
@@parimashelat1716 hmmm - they may have changed where the Rosetta check mark is - look under settings/preferences
now im trying to access my database from parrallels to my hosting mac, i am able to connect it on SSMS but when i tried visual studio community it's just giving me errors like System.Data.SqlClient.TdsParser.ThrowException what could the problem be?
Maybe the connection string you used
hocam kralsin. greetings from Türkiye
Welcome!
@@idrisagiragac 😂 konuyla alakalı gezdiğim 10. video, sadece bu hocam doğru adımları veriyor. 🤟🏼
ayni hisleri tasiyorum!! :D@@salihemrebicer8391
@@salihemrebicer8391m3 mac için de uygun mudur tekniği?
@@salihemrebicer8391 m3 de de aynu şekilde indirilir mi? Bir de harddisk e yüklenilerek kullanılabilir mi?
From where you got the username? it is throwing login error for "sa" as username
Sa is the default Admin account for SQL. You can see the script in the video and might need to make any small changes if you wanted to use something else.
The login error is probably the password - not the username.
I can't find the rosseta option, Im with mac M2
I also do not have the rosetta option, this is so frustrating. Have you found a solution?
your the best
Hello Mr. Frank please where do i find the command prompt i will put in the Terminal
I’ve linked it in the description for the video - can copy and paste it - just change the password to something you like
In SQl management server i am stuck at username. What should i put there?
metoo
Frank, I followed your instructions 100% for the server:2022-latest image using Docker Desktop on a Mac M1 with Rosetta turned on etc. However I cannot access the SQL Server from SSMS on a Parallels Windows 11 ARM VM using the IP address of the MacBook on which the docket image and container was created. Using Docker Desktop v4.27.1 - This is utterly frustrating - The container is there, I have a volume for the data - just cannot connect using the MacBook IP address - What am I missing here?
I’m wondering if there is a firewall running on the Mac that’s blocking access?
@@LearningandTechnology Im having the same problem. Even went to network -> firewall and disabled it, and it still don't work :,(
When you use SSMS, are you using SQL Authentication or Windows Authentication?
You need to use SQL Authentication using the username and password from the script.
Great one. However, I wonder why SQL Server should not be installed directly on Windows 11 using Parallels Desktop on M1/M2? Is it a hardware thing?
It’s the M1 chip issue
@@LearningandTechnology Thank you, sir. I was lost for two days trying to figure out if I had installed fresh Windows 11. I found the answer in your unique video.
How can i find files from sql, im trying to find a restored db bak but it wont appear in files
Can't get Sql management studio to install on my W11 VM in parallels. Even with the container running in docker. Just keep getting install errors :/.
Azure Data Studio will work across multiple architectures - it may be the better option
@@LearningandTechnology Thanks for the reply! I ADS as an option but only found a free 1-month trial. I think I figured it out though. I was using the wrong link on that page and downloading/installing sql 2022 mistakenly.
Hi! I followed all the steps but when connecting to the database it tells me "An existing connection was forcibly closed by the remote host (OS error 10054)" Did I miss something?
is there anyway to use it using Azure
Absolutely! In fact, using Azure makes things even easier - as you are running the Database on Azure and not the local system.
I have a video on how to do this as well. Here is the link:
Build your first SQL Database in Azure Cloud Services
th-cam.com/video/ov27ukpWgdQ/w-d-xo.html
I am sorry I meant to say Azure data studio along with docker! @@LearningandTechnology
Does this method will work with VMwareFusion 13 on Windows 11 arm? thanks
I haven’t tested that configuration unfortunately
@@LearningandTechnology thanks for the response I did tested above config on the VMwareFusion version 13 with windows 11 arm and it worked successfully.
@@shalinkaushik3999 awesome! Thank you for coming back to let everyone know - much appreciated! Great work!
@@shalinkaushik3999 Im using VMwareFusion as well, but I can't connect to my Mac IP, is this something you encountered as well?
I'm having problem with terminal, after pasting address from site shared by you, there password command pops up which is not coming in your case, not able to proceed
It should be the password for Admin permissions on the Mac
why does the login username needs to be "sa"?
It doesn't really - sa is just the SQL default Admin account.
Is parellels free to use? I see only a 14 day trial.
It is not free to use. You can try it and see if it is useful for you. I think I have a discount in the description.
What's the point of installing the server engine in Docker and the management studio in parallels? Why not install both in parallels?
You can’t install it in a VM if you have an M1/2 chip.
@@LearningandTechnology Oh, thank you for clarifying. Yes, on my Mac M1 machine, I have Windows 11 on parallel and tried to install SQL Server Express, but it failed.
Still in the process of setting this up but would it work offline without an internet connection or would I have to go down the Ubuntu path?
It would work without Internet once it’s set up. The container is local to the Mac Mini.
@@LearningandTechnology I guess I'm more asking is this possible without being connected to the local network?
@@huevosrancheros135 that would also work if you used Azure Data Tools instead of SSMS to connect - because Data Tools can run natively on a Mac and then you could use “localhost”
@@LearningandTechnology but then for example would I have to run visual studio on the macOS?
@@huevosrancheros135 no - just Azure Data Studio
Docker 14.26.1 doesn't have "Use Rosetta" option anymore
You will find it in settings > general
I think they moved there since it is not a “features in development” anymore
im not getting the rosetta feature on docker why??
Did you click on the settings? Top right?
yes the option is not even showing up in the settings@@LearningandTechnology
@@rema8073 are you using an M1/M2 Mac?
yes m2 mac@@LearningandTechnology
everything else downloaded and worked but i just dont have that feature@@LearningandTechnology
I love you
Not working "(null): The system administrator (SA) password specified is too long" and password I set was hello123
I would try again - that seems like an issue on your specific install. I’ve had several students do installs over the past few weeks with no issues.
@@LearningandTechnology can you please share the container command for terminal, with the pass that should work.
@@ArbazAbid it’s in the description - I’ve placed it there.
Make sure to change the password if you want something new - also, make it complex with upper/lower case and special characters
I have the same problem, please tell me what is the solution
I solved the problem. My problem was because the password was so weak
why are we writing the ip address of our internet instead of localhost as server name?
Localhost should resolve to the IP of the system in question. It’s a matter of choice - it’s beyond the scope of the video, but using static IPs and DNS is what I’d normally doing I wanted remote clients to resolve to the computer running SQL
@@LearningandTechnology i used hotspot to connect to internet on my laptop and then tried to connect to my sql server the same way you did. obviously i had as my server name the ip address of my internet, but when i tried to connect with hotspot internet, i had an error.
HERO
where is URL ? you forgot to put it ?
All the URL’s are in the Description - check it out.
Am I the only one who can't figure out how he magically pulled up Windows 11? I'm so lost. I'm running the container, I got my IP address, but where is he just opening Windows 11???
It only SEEMS like magic! You can do it too! It’s a virtual machine - here’s a video where I show you how: Use Windows, Linux, and more on a Mac - with Parallels 19
th-cam.com/video/Dvw4giBTZw0/w-d-xo.html
Looks like he used "parralels" which allows you to run windows.
wtf i need parallels to use this video?
Nope.
You only need parallels IF you want to use Windows 11 and SSMS.
You can install Data Tools and be fine to connect with that (or any other client that connects to SQL)
Why not just run everything in the Parallels Windows VM itself???
SQL won’t run on an ARM system. The VM on an M1 (even Windows 11) is ARM - so SQL won’t install.
@@LearningandTechnology oh?! ok so that option's out for me. Any suggestions on the best solution? Am a student, on course until July. I will need to run Power BI as well, so am really scratching my head on this one...
@@PerpetualPreponderer PowerBI runs fine on the Windows 11 VM - it’s just the SQL. Another option is to run SQL in Azure - I have some videos on that too. That’s often what my students do.
@@LearningandTechnology hmm...however using the method in this video, I don't need to worry about Windows licence correct? Can I also then run Power BI in docker?
@@PerpetualPreponderer it’s all trial or Developer licenses for students - so you’re good there. Yes - you can use Docker
Parallels is a must-have for anyone using a Mac and needing access to Windows and Linux. Here is my affiliate link to check it out: prf.hn/l/melkMOm
Macs are excellent machines, but it does not work for serious programming, I am frustrated because visual studio 2022 will no longer work on Mac, for me the best option would be Mac with Windows, I think Windows is already more advanced than Mac OS .
You have the visual studio for mac, I think it still work
@@pn908 MS announced they will end its support in later 2024, either use VS Code or Virtualisation or JetBrains
You saved my @s$$! I ran into zero issues. Too bad it took me all day to finally find this video.