C
C#2y ago
Stef

✅ MSSQL on Mac help

Hi guys, I have an upcoming course at my university that requires me to install SQL Server 2022 and SSMS, but the problem is those apps are exclusively for Windows. I'm on an M2 mac, and I have a student license for JB DataGrip. Can anyone help me set up DataGrip so it has the same functionality as SSMS with the SQL server (if it's at all possible). I tried using the guide on DataGrips' forums, but I'm not sure I actually achieved anything. Thanks in advance!
177 Replies
Stef
StefOP2y ago
If DataGrip doesn't work, please recommend something else, I just want to know if it's even possible to get the same functionality as I would on Windows
SinFluxx
SinFluxx2y ago
I don't think you can do SQL Server on non-windows machines, though I may be wrong
sibber
sibber2y ago
worst case you install a windows vm
Stef
StefOP2y ago
:/
sibber
sibber2y ago
parallels is really popular
Stef
StefOP2y ago
I've read about Docker, but I tried running all the commands and it just blew up in my face after it realized im on the arm chipset ty, ill check it out
sibber
sibber2y ago
oh yeah docker could work too docker should work on m1 or m2
Stef
StefOP2y ago
ye, but thats what I need help with I can't figure out how to do it plus i need mssql apparantly (bear with me, I don't understand anything about sql and servers and so on, yet)
sibber
sibber2y ago
did you install docker?
Stef
StefOP2y ago
ye, then i ran the commands for sql 2022, it downloaded just fine, but when I tried to run it it failed because i was on the wrong chipset
sibber
sibber2y ago
what command did you run
Stef
StefOP2y ago
yeah i tried basically the same thing, except not for azure but for datagrip i might have to use azure tho apparently
sibber
sibber2y ago
datagrip works too
Pobiega
Pobiega2y ago
SQL server is definately not windows only, it has a linux version among other things
sibber
sibber2y ago
you can connect with anything
Stef
StefOP2y ago
when i tried i got an error
Pobiega
Pobiega2y ago
SSMS is however, but datagrip should cover most cases Ah, its an M1 mac that might complicate things
Stef
StefOP2y ago
would azure sql edge be exclusive to azure? yee :/ so ive been told i meant to reply to the other message
sibber
sibber2y ago
no that just seems to be the name of the image by microsoft so just pull that and run it
Stef
StefOP2y ago
im still new to this, is this ms sql?
sibber
sibber2y ago
yes
Stef
StefOP2y ago
just with a different name
sibber
sibber2y ago
its the thing that lets you run ms sql basically in your case
Stef
StefOP2y ago
alright, ill go run it, be back later thnx for the help guys
Pobiega
Pobiega2y ago
I'd try this first thou
Stef
StefOP2y ago
thats the exact one i ran
Pobiega
Pobiega2y ago
Im not entirely sure what azure edge is.
Small-footprint, edge-optimized SQL database engine with built-in AI
?
Stef
StefOP2y ago
and it threw an error because i was on the arm chipset here, ill show you the error one sec
sibber
sibber2y ago
Azure SQL Edge is built on the latest version of the SQL Database Engine. It supports a subset of the features supported in SQL Server 2022 on Linux, in addition to some features that are currently not supported or available in SQL Server 2022 on Linux (or in SQL Server on Windows).
oh wait its not sql server huh
Pobiega
Pobiega2y ago
yeah idk, seems like a fork of sorts
sibber
sibber2y ago
when did microsoft create another database engine
Pobiega
Pobiega2y ago
https://bornsql.ca/blog/you-can-run-a-sql-server-docker-container-on-apple-m1-and-m2-silicon/
Find the “Features in development” option, and select the “Use Rosetta for x86/amd64 emulation on Apple Silicon” checkbox
Stef
StefOP2y ago
Stef
StefOP2y ago
now its not even downloading
Pobiega
Pobiega2y ago
you need to enable x86 emulation in docker it seems makes sense. open the docker dashboard, go to settings
Stef
StefOP2y ago
Stef
StefOP2y ago
this right?
Pobiega
Pobiega2y ago
yep! make sure you restart the docker engine after applying that change
Stef
StefOP2y ago
gotcha lemme run the command again now
Pobiega
Pobiega2y ago
and I suppose verify that virtualization support is turned on
Stef
StefOP2y ago
umm wdym
Pobiega
Pobiega2y ago
Stef
StefOP2y ago
Stef
StefOP2y ago
this is all i have in the general tab oh im dumb yeah its checkmarked
Pobiega
Pobiega2y ago
😛
Stef
StefOP2y ago
yay, its downloading at least
Stef
StefOP2y ago
Stef
StefOP2y ago
so once its downloaded i run this irght and i change the password
mindhardt
mindhardt2y ago
There is actually a MSSQL arm image
Pobiega
Pobiega2y ago
sure
mindhardt
mindhardt2y ago
kinda
Pobiega
Pobiega2y ago
is there?
mindhardt
mindhardt2y ago
It is called something like Azure SQL edge
Pobiega
Pobiega2y ago
yeah we already talked about that
mindhardt
mindhardt2y ago
Not documented but I could connect once
Pobiega
Pobiega2y ago
its not really SQL server
mindhardt
mindhardt2y ago
Oh, sry
Pobiega
Pobiega2y ago
i mean, its an SQL database and it has a subset of SQL Servers features, plus some that are unique to it
mindhardt
mindhardt2y ago
My efcore+MSSQL could connect before but I didn't do anything but create table + cruds
MODiX
MODiX2y ago
Cyberrex
Azure SQL Edge is built on the latest version of the SQL Database Engine. It supports a subset of the features supported in SQL Server 2022 on Linux, in addition to some features that are currently not supported or available in SQL Server 2022 on Linux (or in SQL Server on Windows).
Quoted by
<@105026391237480448> from #MSSQL on Mac help (click here)
React with ❌ to remove this embed.
mindhardt
mindhardt2y ago
Yea, I see Postgres supremacy again
Pobiega
Pobiega2y ago
agreed 😄
Stef
StefOP2y ago
ahh
Stef
StefOP2y ago
Stef
StefOP2y ago
again! am i missing something
Pobiega
Pobiega2y ago
the top warning is expected and not a problem, says the guide I found but the missing argument...
sudo docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=<YourStrong@Passw0rd>" \ -p 1433:1433 --name sql1 --hostname sql1 \ -d \ mcr.microsoft.com/mssql/server:2022-latest
Stef
StefOP2y ago
run it?
Pobiega
Pobiega2y ago
uhm, yes? isnt that what this entire thread is about? 😄
Stef
StefOP2y ago
haha sry, wasnt sure woops
Stef
StefOP2y ago
Stef
StefOP2y ago
same thing
Pobiega
Pobiega2y ago
not sure then might have better luck installing a normal x64 VM
Stef
StefOP2y ago
i can try uninstalling everything and trying again and if that doesnt work then yeah prob my best option
Pobiega
Pobiega2y ago
try rebooting once first might help if the engine has gotten into a weird state docker can be fickle at times
Stef
StefOP2y ago
\
Stef
StefOP2y ago
xd, now this after restart
Pobiega
Pobiega2y ago
... hm /sql1 ?
Stef
StefOP2y ago
well its from the thing you sent idk
Pobiega
Pobiega2y ago
well, but the slashes are anti-linebreak I'd expect it to register with the containername sql1 try docker ps -a
Stef
StefOP2y ago
maybe i can try it again but delete the slashes
Stef
StefOP2y ago
Pobiega
Pobiega2y ago
woohoo!
Stef
StefOP2y ago
wait it worked?
Pobiega
Pobiega2y ago
so it can create the containers at least well, it has created them lets see if it can run them 😄
Stef
StefOP2y ago
should there be two tho? or we want only the sql1
Pobiega
Pobiega2y ago
its fine for now we can remove the other one later
Stef
StefOP2y ago
ok
Pobiega
Pobiega2y ago
try docker start sql1
Stef
StefOP2y ago
ok
Stef
StefOP2y ago
Pobiega
Pobiega2y ago
:/ idk what "readlink" means
Stef
StefOP2y ago
Stack Overflow
ERROR: readlink /var/lib/docker/overlay2: invalid argument
This morning I was getting this error when executing docker-compose up: docker-compose up ERROR: readlink /var/lib/docker/overlay2: invalid argument
Stef
StefOP2y ago
maybe this? can you check it to make sure i dont do anything stupid
Pobiega
Pobiega2y ago
try docker start --verbose sql1
Stef
StefOP2y ago
"unknown flag --verbose"
Pobiega
Pobiega2y ago
hm then thats a docker-compose flag
Stef
StefOP2y ago
whatever THAT means haha
Pobiega
Pobiega2y ago
docker compose is a tool to run several containers at once
sibber
sibber2y ago
Not all images are available for ARM64 architecture. You can add --platform linux/amd64 to run an Intel image under emulation.
did you do this?
Stef
StefOP2y ago
dont think so i dont know where to add it now
sibber
sibber2y ago
at the end doesnt matter really
Pobiega
Pobiega2y ago
you'd add that to the docker run command
Stef
StefOP2y ago
so rerun the command ill make an sql2 containter then i guess and add that same thing but it still created it
Stef
StefOP2y ago
Stef
StefOP2y ago
Stef
StefOP2y ago
and docker start sql2 doesnt work
sibber
sibber2y ago
Warning to others: having the --platform linux/amd64 at the end of the command does not work - it seems to be best placed before declaring the image name
try this maybe
Stef
StefOP2y ago
sudo docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=<YourStrong@Passw0rd>" \ -p 1433:1433 --platform linux/amd64 --name sql1 --hostname sql1 \ -d \ mcr.microsoft.com/mssql/server:2022-latest smth like this?
sibber
sibber2y ago
do you need sudo?
Stef
StefOP2y ago
im just typing what Pobiega sent idk anything about this shit haha
sibber
sibber2y ago
sure try that
Pobiega
Pobiega2y ago
that seems fine, and it also said in the feedback that the requested platform was amd64
Stef
StefOP2y ago
ok slight progress, at least we dont get the chipset error
sibber
sibber2y ago
yeah but maybe it needed to be specified explicitly?
Stef
StefOP2y ago
i mean it was making the containers no problem just for some reason i cant start them cuz of some invalid argument error this is a lot of fun :)) i love mac
Pobiega
Pobiega2y ago
to be fair, this isnt a mac issue. its an arm64 issue thats a different processor architecture and not all software is compiled to work with it
Stef
StefOP2y ago
im just wondering wth the invalid argument is on every single guide it works for arm64 and every forum i check for the readlink thing i dont get a concrete answer
Kris
Kris2y ago
Azure data studio worked for me on mac Let me know where you're stuck. I setup a .net 4.7.2 inside parallels on a mac. I may have installed mssql inside the windows container in parallels and used azure data studio to connect to it. Ahh I may have done it on docker too. Sorry the details are a bit fuzzy, it's been a while
Stef
StefOP2y ago
id prefer not to download a vm tbh im still stuck on this stupid error
Kris
Kris2y ago
Have you tried this? https://blog.logrocket.com/docker-sql-server/ I prefer docker-compose because it's, composable lol
Kyle Galbraith
LogRocket Blog
How to run SQL Server in a Docker container - LogRocket Blog
You can use Microsoft SQL Server across multiple platforms with Docker. Learn how to launch an SQL Server database inside a Docker container.
Pobiega
Pobiega2y ago
remember, this is an M1 mac we are talking about
Kris
Kris2y ago
Yeah, i use a m1 mac
Pobiega
Pobiega2y ago
so its an arm64 chipset
Kris
Kris2y ago
Try adding platform: linux/x86_64 inside the container
Kris
Kris2y ago
This is wp but it should work
Pobiega
Pobiega2y ago
okay. the sql-server images dont have an arm64 version, so there is some issues with running it under amd64 with emulation
Kris
Kris2y ago
Yeah the platform prop should (fingers crossed) alleviate that
MODiX
MODiX2y ago
Cyberrex
Warning to others: having the --platform linux/amd64 at the end of the command does not work - it seems to be best placed before declaring the image name
Quoted by
<@105026391237480448> from #MSSQL on Mac help (click here)
React with ❌ to remove this embed.
Stef
StefOP2y ago
we did all that
Pobiega
Pobiega2y ago
yup
Stef
StefOP2y ago
all that changed was i didnt get the error that it isnt supported
Kris
Kris2y ago
Ahhh damn. Sorry.
Stef
StefOP2y ago
but i still coundt run it because of the Error response from daemon: readlink /var/lib/docker/overlay2/l: invalid argument.
Kris
Kris2y ago
One sec, I haven't booted up my work mac in a while lol Off topic: been a massive fan of windows + WSL2. It's amazing
Pobiega
Pobiega2y ago
Yup, it's very good
Kris
Kris2y ago
@stefzcu okay sorry, i remember now, my mssql was inside of parallels. I apologize for adding noise to this issue
Stef
StefOP2y ago
yeah i figured i still dont understand anything, but if it worked for you it owuld have worked for me i guess i gotta turn on ol' rusty for my uni course for windows its as simple as just downloading sql server 2022 right?
Kris
Kris2y ago
Yes, in windows it should just work. Or you can also spend $5 and spin up a DO for it (Disclaimer idk if docker supports mssql)
Stef
StefOP2y ago
sry man, im a bit frustrated it cant just work natively why cant things just work!
Kris
Kris2y ago
You're on a mac, it should just work! (I kid) Yeah it's def frustrating.
Stef
StefOP2y ago
hahaha
Pobiega
Pobiega2y ago
well, its because x86/x64 was the dominant architecture for SO LONG for most usecases the M1 was quite revolutionary, as its the first really powerful consumer-grade arm64 proccessor its a really cool piece of hardware, but it does mean some stuff doesnt work with it yet sadly
Stef
StefOP2y ago
will there ever be support from microsoft tho visual studio for mac has been garbage since its inception
Kris
Kris2y ago
I use Rider catshrug
Pobiega
Pobiega2y ago
for sql server specifically, dunno. for other thingss, yes
Stef
StefOP2y ago
me2 theres no other way
Pobiega
Pobiega2y ago
VS for mac is garbage, thats true but dotnet itself runs fine on arm64
Stef
StefOP2y ago
well yeah i guess beggars can tbe choosers i guess
Kris
Kris2y ago
Why do you need mssql?
Pobiega
Pobiega2y ago
school
Stef
StefOP2y ago
yeah
Kris
Kris2y ago
Ahh. I you have a windows machine at home just host a mssql in it and open it up 😄
Stef
StefOP2y ago
since i dont know anything, idk if theres like an equivalent to mssql but im guessing not
Pobiega
Pobiega2y ago
well, define "equivalent "
Stef
StefOP2y ago
thats my only good option now tbh
Pobiega
Pobiega2y ago
there are many other sql server programs but they have their differences their SQL dialects are different, and they do some things differently
Stef
StefOP2y ago
well yeah, thats what im worried about, if the differences are what i need to pass
Pobiega
Pobiega2y ago
exactly for schoolwork, its safest to just use the versions the school specifies
Kris
Kris2y ago
Why are you trying to avoid parallels? It's been really good for me. Just curious.
Stef
StefOP2y ago
money, and i do have a windows machine, its just a desktop
Kris
Kris2y ago
Ahhh
Stef
StefOP2y ago
and ive been enjoying using a laptop
Kris
Kris2y ago
Damn this suggestion is going to suck, why not just remote to your windows machine?
Pobiega
Pobiega2y ago
doesnt suck too much, thats literally how I work from home 😄
Stef
StefOP2y ago
i didnt wanna make a big deal out of it, because i do have the option to do everything on my desktop, i just would have liked for it to work on the mac
Pobiega
Pobiega2y ago
I just remotecontrol my work computer
Stef
StefOP2y ago
isnt the delay gonna be horrible and my desktop has to always be on
Pobiega
Pobiega2y ago
delay? 5 ms isnt too much and yes, the desktop needs to be on.
Stef
StefOP2y ago
what program should i use i might try that
Pobiega
Pobiega2y ago
you have a few options. Chrome remote desktop is probably the easiest, and also works with NAT and other restrictive network setups gotta dip out, best of luck
Stef
StefOP2y ago
aight g, thnx for everything
Kris
Kris2y ago
GL!
Stef
StefOP2y ago
tyty its been helpful
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Stef
StefOP2y ago
/close

Did you find this page helpful?