C
C#16mo 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
StefOP16mo 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
SinFluxx16mo ago
I don't think you can do SQL Server on non-windows machines, though I may be wrong
sibber
sibber16mo ago
worst case you install a windows vm
Stef
StefOP16mo ago
:/
sibber
sibber16mo ago
parallels is really popular
Stef
StefOP16mo 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
sibber16mo ago
oh yeah docker could work too docker should work on m1 or m2
Stef
StefOP16mo 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
sibber16mo ago
did you install docker?
Stef
StefOP16mo 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
sibber16mo ago
what command did you run
Stef
StefOP16mo ago
yeah i tried basically the same thing, except not for azure but for datagrip i might have to use azure tho apparently
sibber
sibber16mo ago
datagrip works too
Pobiega
Pobiega16mo ago
SQL server is definately not windows only, it has a linux version among other things
sibber
sibber16mo ago
you can connect with anything
Stef
StefOP16mo ago
when i tried i got an error
Pobiega
Pobiega16mo ago
SSMS is however, but datagrip should cover most cases Ah, its an M1 mac that might complicate things
Stef
StefOP16mo ago
would azure sql edge be exclusive to azure? yee :/ so ive been told i meant to reply to the other message
sibber
sibber16mo ago
no that just seems to be the name of the image by microsoft so just pull that and run it
Stef
StefOP16mo ago
im still new to this, is this ms sql?
sibber
sibber16mo ago
yes
Stef
StefOP16mo ago
just with a different name
sibber
sibber16mo ago
its the thing that lets you run ms sql basically in your case
Stef
StefOP16mo ago
alright, ill go run it, be back later thnx for the help guys
Pobiega
Pobiega16mo ago
I'd try this first thou
Stef
StefOP16mo ago
thats the exact one i ran
Pobiega
Pobiega16mo ago
Im not entirely sure what azure edge is.
Small-footprint, edge-optimized SQL database engine with built-in AI
?
Stef
StefOP16mo ago
and it threw an error because i was on the arm chipset here, ill show you the error one sec
sibber
sibber16mo 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
Pobiega16mo ago
yeah idk, seems like a fork of sorts
sibber
sibber16mo ago
when did microsoft create another database engine
Pobiega
Pobiega16mo 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
StefOP16mo ago
Stef
StefOP16mo ago
now its not even downloading
Pobiega
Pobiega16mo ago
you need to enable x86 emulation in docker it seems makes sense. open the docker dashboard, go to settings
Stef
StefOP16mo ago
Stef
StefOP16mo ago
this right?
Pobiega
Pobiega16mo ago
yep! make sure you restart the docker engine after applying that change
Stef
StefOP16mo ago
gotcha lemme run the command again now
Pobiega
Pobiega16mo ago
and I suppose verify that virtualization support is turned on
Stef
StefOP16mo ago
umm wdym
Pobiega
Pobiega16mo ago
Stef
StefOP16mo ago
Stef
StefOP16mo ago
this is all i have in the general tab oh im dumb yeah its checkmarked
Pobiega
Pobiega16mo ago
😛
Stef
StefOP16mo ago
yay, its downloading at least
Stef
StefOP16mo ago
Stef
StefOP16mo ago
so once its downloaded i run this irght and i change the password
mindhardt
mindhardt16mo ago
There is actually a MSSQL arm image
Pobiega
Pobiega16mo ago
sure
mindhardt
mindhardt16mo ago
kinda
Pobiega
Pobiega16mo ago
is there?
mindhardt
mindhardt16mo ago
It is called something like Azure SQL edge
Pobiega
Pobiega16mo ago
yeah we already talked about that
mindhardt
mindhardt16mo ago
Not documented but I could connect once
Pobiega
Pobiega16mo ago
its not really SQL server
mindhardt
mindhardt16mo ago
Oh, sry
Pobiega
Pobiega16mo ago
i mean, its an SQL database and it has a subset of SQL Servers features, plus some that are unique to it
mindhardt
mindhardt16mo ago
My efcore+MSSQL could connect before but I didn't do anything but create table + cruds
MODiX
MODiX16mo 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
mindhardt16mo ago
Yea, I see Postgres supremacy again
Pobiega
Pobiega16mo ago
agreed 😄
Stef
StefOP16mo ago
ahh
Stef
StefOP16mo ago
Stef
StefOP16mo ago
again! am i missing something
Pobiega
Pobiega16mo 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
StefOP16mo ago
run it?
Pobiega
Pobiega16mo ago
uhm, yes? isnt that what this entire thread is about? 😄
Stef
StefOP16mo ago
haha sry, wasnt sure woops
Stef
StefOP16mo ago
Stef
StefOP16mo ago
same thing
Pobiega
Pobiega16mo ago
not sure then might have better luck installing a normal x64 VM
Stef
StefOP16mo ago
i can try uninstalling everything and trying again and if that doesnt work then yeah prob my best option
Pobiega
Pobiega16mo ago
try rebooting once first might help if the engine has gotten into a weird state docker can be fickle at times
Stef
StefOP16mo ago
\
Stef
StefOP16mo ago
xd, now this after restart
Pobiega
Pobiega16mo ago
... hm /sql1 ?
Stef
StefOP16mo ago
well its from the thing you sent idk
Pobiega
Pobiega16mo ago
well, but the slashes are anti-linebreak I'd expect it to register with the containername sql1 try docker ps -a
Stef
StefOP16mo ago
maybe i can try it again but delete the slashes
Stef
StefOP16mo ago
Pobiega
Pobiega16mo ago
woohoo!
Stef
StefOP16mo ago
wait it worked?
Pobiega
Pobiega16mo ago
so it can create the containers at least well, it has created them lets see if it can run them 😄
Stef
StefOP16mo ago
should there be two tho? or we want only the sql1
Pobiega
Pobiega16mo ago
its fine for now we can remove the other one later
Stef
StefOP16mo ago
ok
Pobiega
Pobiega16mo ago
try docker start sql1
Stef
StefOP16mo ago
ok
Stef
StefOP16mo ago
Pobiega
Pobiega16mo ago
:/ idk what "readlink" means
Stef
StefOP16mo 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
StefOP16mo ago
maybe this? can you check it to make sure i dont do anything stupid
Pobiega
Pobiega16mo ago
try docker start --verbose sql1
Stef
StefOP16mo ago
"unknown flag --verbose"
Pobiega
Pobiega16mo ago
hm then thats a docker-compose flag
Stef
StefOP16mo ago
whatever THAT means haha
Pobiega
Pobiega16mo ago
docker compose is a tool to run several containers at once
sibber
sibber16mo 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
StefOP16mo ago
dont think so i dont know where to add it now
sibber
sibber16mo ago
at the end doesnt matter really
Pobiega
Pobiega16mo ago
you'd add that to the docker run command
Stef
StefOP16mo ago
so rerun the command ill make an sql2 containter then i guess and add that same thing but it still created it
Stef
StefOP16mo ago
Stef
StefOP16mo ago
Stef
StefOP16mo ago
and docker start sql2 doesnt work
sibber
sibber16mo 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
StefOP16mo 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
sibber16mo ago
do you need sudo?
Stef
StefOP16mo ago
im just typing what Pobiega sent idk anything about this shit haha
sibber
sibber16mo ago
sure try that
Pobiega
Pobiega16mo ago
that seems fine, and it also said in the feedback that the requested platform was amd64
Stef
StefOP16mo ago
ok slight progress, at least we dont get the chipset error
sibber
sibber16mo ago
yeah but maybe it needed to be specified explicitly?
Stef
StefOP16mo 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
Pobiega16mo 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
StefOP16mo 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
Kris16mo 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
StefOP16mo ago
id prefer not to download a vm tbh im still stuck on this stupid error
Kris
Kris16mo 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
Pobiega16mo ago
remember, this is an M1 mac we are talking about
Kris
Kris16mo ago
Yeah, i use a m1 mac
Pobiega
Pobiega16mo ago
so its an arm64 chipset
Kris
Kris16mo ago
Try adding platform: linux/x86_64 inside the container
Kris
Kris16mo ago
This is wp but it should work
Pobiega
Pobiega16mo ago
okay. the sql-server images dont have an arm64 version, so there is some issues with running it under amd64 with emulation
Kris
Kris16mo ago
Yeah the platform prop should (fingers crossed) alleviate that
MODiX
MODiX16mo 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
StefOP16mo ago
we did all that
Pobiega
Pobiega16mo ago
yup
Stef
StefOP16mo ago
all that changed was i didnt get the error that it isnt supported
Kris
Kris16mo ago
Ahhh damn. Sorry.
Stef
StefOP16mo ago
but i still coundt run it because of the Error response from daemon: readlink /var/lib/docker/overlay2/l: invalid argument.
Kris
Kris16mo 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
Pobiega16mo ago
Yup, it's very good
Kris
Kris16mo ago
@stefzcu okay sorry, i remember now, my mssql was inside of parallels. I apologize for adding noise to this issue
Stef
StefOP16mo 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
Kris16mo 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
StefOP16mo ago
sry man, im a bit frustrated it cant just work natively why cant things just work!
Kris
Kris16mo ago
You're on a mac, it should just work! (I kid) Yeah it's def frustrating.
Stef
StefOP16mo ago
hahaha
Pobiega
Pobiega16mo 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
StefOP16mo ago
will there ever be support from microsoft tho visual studio for mac has been garbage since its inception
Kris
Kris16mo ago
I use Rider catshrug
Pobiega
Pobiega16mo ago
for sql server specifically, dunno. for other thingss, yes
Stef
StefOP16mo ago
me2 theres no other way
Pobiega
Pobiega16mo ago
VS for mac is garbage, thats true but dotnet itself runs fine on arm64
Stef
StefOP16mo ago
well yeah i guess beggars can tbe choosers i guess
Kris
Kris16mo ago
Why do you need mssql?
Pobiega
Pobiega16mo ago
school
Stef
StefOP16mo ago
yeah
Kris
Kris16mo ago
Ahh. I you have a windows machine at home just host a mssql in it and open it up 😄
Stef
StefOP16mo ago
since i dont know anything, idk if theres like an equivalent to mssql but im guessing not
Pobiega
Pobiega16mo ago
well, define "equivalent "
Stef
StefOP16mo ago
thats my only good option now tbh
Pobiega
Pobiega16mo 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
StefOP16mo ago
well yeah, thats what im worried about, if the differences are what i need to pass
Pobiega
Pobiega16mo ago
exactly for schoolwork, its safest to just use the versions the school specifies
Kris
Kris16mo ago
Why are you trying to avoid parallels? It's been really good for me. Just curious.
Stef
StefOP16mo ago
money, and i do have a windows machine, its just a desktop
Kris
Kris16mo ago
Ahhh
Stef
StefOP16mo ago
and ive been enjoying using a laptop
Kris
Kris16mo ago
Damn this suggestion is going to suck, why not just remote to your windows machine?
Pobiega
Pobiega16mo ago
doesnt suck too much, thats literally how I work from home 😄
Stef
StefOP16mo 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
Pobiega16mo ago
I just remotecontrol my work computer
Stef
StefOP16mo ago
isnt the delay gonna be horrible and my desktop has to always be on
Pobiega
Pobiega16mo ago
delay? 5 ms isnt too much and yes, the desktop needs to be on.
Stef
StefOP16mo ago
what program should i use i might try that
Pobiega
Pobiega16mo 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
StefOP16mo ago
aight g, thnx for everything
Kris
Kris16mo ago
GL!
Stef
StefOP16mo ago
tyty its been helpful
Accord
Accord16mo 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
StefOP16mo ago
/close
Want results from more Discord servers?
Add your server