C
C#12mo 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
Stef12mo 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
SinFluxx12mo ago
I don't think you can do SQL Server on non-windows machines, though I may be wrong
sibber
sibber12mo ago
worst case you install a windows vm
Stef
Stef12mo ago
:/
sibber
sibber12mo ago
parallels is really popular
Stef
Stef12mo 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
sibber12mo ago
oh yeah docker could work too docker should work on m1 or m2
Stef
Stef12mo 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
sibber12mo ago
did you install docker?
Stef
Stef12mo 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
sibber12mo ago
what command did you run
Stef
Stef12mo ago
yeah i tried basically the same thing, except not for azure but for datagrip i might have to use azure tho apparently
sibber
sibber12mo ago
datagrip works too
Pobiega
Pobiega12mo ago
SQL server is definately not windows only, it has a linux version among other things
sibber
sibber12mo ago
you can connect with anything
Stef
Stef12mo ago
when i tried i got an error
Pobiega
Pobiega12mo ago
SSMS is however, but datagrip should cover most cases Ah, its an M1 mac that might complicate things
Stef
Stef12mo ago
would azure sql edge be exclusive to azure? yee :/ so ive been told i meant to reply to the other message
sibber
sibber12mo ago
no that just seems to be the name of the image by microsoft so just pull that and run it
Stef
Stef12mo ago
im still new to this, is this ms sql?
sibber
sibber12mo ago
yes
Stef
Stef12mo ago
just with a different name
sibber
sibber12mo ago
its the thing that lets you run ms sql basically in your case
Stef
Stef12mo ago
alright, ill go run it, be back later thnx for the help guys
Pobiega
Pobiega12mo ago
I'd try this first thou
Stef
Stef12mo ago
thats the exact one i ran
Pobiega
Pobiega12mo ago
Im not entirely sure what azure edge is.
Small-footprint, edge-optimized SQL database engine with built-in AI
?
Stef
Stef12mo ago
and it threw an error because i was on the arm chipset here, ill show you the error one sec
sibber
sibber12mo 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
Pobiega12mo ago
yeah idk, seems like a fork of sorts
sibber
sibber12mo ago
when did microsoft create another database engine
Pobiega
Pobiega12mo 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
Stef12mo ago
Stef
Stef12mo ago
now its not even downloading
Pobiega
Pobiega12mo ago
you need to enable x86 emulation in docker it seems makes sense. open the docker dashboard, go to settings
Stef
Stef12mo ago
Stef
Stef12mo ago
this right?
Pobiega
Pobiega12mo ago
yep! make sure you restart the docker engine after applying that change
Stef
Stef12mo ago
gotcha lemme run the command again now
Pobiega
Pobiega12mo ago
and I suppose verify that virtualization support is turned on
Stef
Stef12mo ago
umm wdym
Pobiega
Pobiega12mo ago
Stef
Stef12mo ago
Stef
Stef12mo ago
this is all i have in the general tab oh im dumb yeah its checkmarked
Pobiega
Pobiega12mo ago
😛
Stef
Stef12mo ago
yay, its downloading at least
Stef
Stef12mo ago
Stef
Stef12mo ago
so once its downloaded i run this irght and i change the password
mindhardt
mindhardt12mo ago
There is actually a MSSQL arm image
Pobiega
Pobiega12mo ago
sure
mindhardt
mindhardt12mo ago
kinda
Pobiega
Pobiega12mo ago
is there?
mindhardt
mindhardt12mo ago
It is called something like Azure SQL edge
Pobiega
Pobiega12mo ago
yeah we already talked about that
mindhardt
mindhardt12mo ago
Not documented but I could connect once
Pobiega
Pobiega12mo ago
its not really SQL server
mindhardt
mindhardt12mo ago
Oh, sry
Pobiega
Pobiega12mo ago
i mean, its an SQL database and it has a subset of SQL Servers features, plus some that are unique to it
mindhardt
mindhardt12mo ago
My efcore+MSSQL could connect before but I didn't do anything but create table + cruds
MODiX
MODiX12mo 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
mindhardt12mo ago
Yea, I see Postgres supremacy again
Pobiega
Pobiega12mo ago
agreed 😄
Stef
Stef12mo ago
ahh
Stef
Stef12mo ago
Stef
Stef12mo ago
again! am i missing something
Pobiega
Pobiega12mo 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
Stef12mo ago
run it?
Pobiega
Pobiega12mo ago
uhm, yes? isnt that what this entire thread is about? 😄
Stef
Stef12mo ago
haha sry, wasnt sure woops
Stef
Stef12mo ago
Stef
Stef12mo ago
same thing
Pobiega
Pobiega12mo ago
not sure then might have better luck installing a normal x64 VM
Stef
Stef12mo ago
i can try uninstalling everything and trying again and if that doesnt work then yeah prob my best option
Pobiega
Pobiega12mo ago
try rebooting once first might help if the engine has gotten into a weird state docker can be fickle at times
Stef
Stef12mo ago
\
Stef
Stef12mo ago
xd, now this after restart
Pobiega
Pobiega12mo ago
... hm /sql1 ?
Stef
Stef12mo ago
well its from the thing you sent idk
Pobiega
Pobiega12mo ago
well, but the slashes are anti-linebreak I'd expect it to register with the containername sql1 try docker ps -a
Stef
Stef12mo ago
maybe i can try it again but delete the slashes
Stef
Stef12mo ago
Pobiega
Pobiega12mo ago
woohoo!
Stef
Stef12mo ago
wait it worked?
Pobiega
Pobiega12mo ago
so it can create the containers at least well, it has created them lets see if it can run them 😄
Stef
Stef12mo ago
should there be two tho? or we want only the sql1
Pobiega
Pobiega12mo ago
its fine for now we can remove the other one later
Stef
Stef12mo ago
ok
Pobiega
Pobiega12mo ago
try docker start sql1
Stef
Stef12mo ago
ok
Stef
Stef12mo ago
Pobiega
Pobiega12mo ago
:/ idk what "readlink" means
Stef
Stef12mo 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
Stef12mo ago
maybe this? can you check it to make sure i dont do anything stupid
Pobiega
Pobiega12mo ago
try docker start --verbose sql1
Stef
Stef12mo ago
"unknown flag --verbose"
Pobiega
Pobiega12mo ago
hm then thats a docker-compose flag
Stef
Stef12mo ago
whatever THAT means haha
Pobiega
Pobiega12mo ago
docker compose is a tool to run several containers at once
sibber
sibber12mo 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
Stef12mo ago
dont think so i dont know where to add it now
sibber
sibber12mo ago
at the end doesnt matter really
Pobiega
Pobiega12mo ago
you'd add that to the docker run command
Stef
Stef12mo ago
so rerun the command ill make an sql2 containter then i guess and add that same thing but it still created it
Stef
Stef12mo ago
Stef
Stef12mo ago
Stef
Stef12mo ago
and docker start sql2 doesnt work
sibber
sibber12mo 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
Stef12mo 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
sibber12mo ago
do you need sudo?
Stef
Stef12mo ago
im just typing what Pobiega sent idk anything about this shit haha
sibber
sibber12mo ago
sure try that
Pobiega
Pobiega12mo ago
that seems fine, and it also said in the feedback that the requested platform was amd64
Stef
Stef12mo ago
ok slight progress, at least we dont get the chipset error
sibber
sibber12mo ago
yeah but maybe it needed to be specified explicitly?
Stef
Stef12mo 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
Pobiega12mo 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
Stef12mo 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
Kris12mo 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
Stef12mo ago
id prefer not to download a vm tbh im still stuck on this stupid error
Kris
Kris12mo 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
Pobiega12mo ago
remember, this is an M1 mac we are talking about
Kris
Kris12mo ago
Yeah, i use a m1 mac
Pobiega
Pobiega12mo ago
so its an arm64 chipset
Kris
Kris12mo ago
Try adding platform: linux/x86_64 inside the container
Kris
Kris12mo ago
This is wp but it should work
Pobiega
Pobiega12mo ago
okay. the sql-server images dont have an arm64 version, so there is some issues with running it under amd64 with emulation
Kris
Kris12mo ago
Yeah the platform prop should (fingers crossed) alleviate that
MODiX
MODiX12mo 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
Stef12mo ago
we did all that
Pobiega
Pobiega12mo ago
yup
Stef
Stef12mo ago
all that changed was i didnt get the error that it isnt supported
Kris
Kris12mo ago
Ahhh damn. Sorry.
Stef
Stef12mo ago
but i still coundt run it because of the Error response from daemon: readlink /var/lib/docker/overlay2/l: invalid argument.
Kris
Kris12mo 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
Pobiega12mo ago
Yup, it's very good
Kris
Kris12mo ago
@stefzcu okay sorry, i remember now, my mssql was inside of parallels. I apologize for adding noise to this issue
Stef
Stef12mo 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
Kris12mo 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
Stef12mo ago
sry man, im a bit frustrated it cant just work natively why cant things just work!
Kris
Kris12mo ago
You're on a mac, it should just work! (I kid) Yeah it's def frustrating.
Stef
Stef12mo ago
hahaha
Pobiega
Pobiega12mo 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
Stef12mo ago
will there ever be support from microsoft tho visual studio for mac has been garbage since its inception
Kris
Kris12mo ago
I use Rider catshrug
Pobiega
Pobiega12mo ago
for sql server specifically, dunno. for other thingss, yes
Stef
Stef12mo ago
me2 theres no other way
Pobiega
Pobiega12mo ago
VS for mac is garbage, thats true but dotnet itself runs fine on arm64
Stef
Stef12mo ago
well yeah i guess beggars can tbe choosers i guess
Kris
Kris12mo ago
Why do you need mssql?
Pobiega
Pobiega12mo ago
school
Stef
Stef12mo ago
yeah
Kris
Kris12mo ago
Ahh. I you have a windows machine at home just host a mssql in it and open it up 😄
Stef
Stef12mo ago
since i dont know anything, idk if theres like an equivalent to mssql but im guessing not
Pobiega
Pobiega12mo ago
well, define "equivalent "
Stef
Stef12mo ago
thats my only good option now tbh
Pobiega
Pobiega12mo 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
Stef12mo ago
well yeah, thats what im worried about, if the differences are what i need to pass
Pobiega
Pobiega12mo ago
exactly for schoolwork, its safest to just use the versions the school specifies
Kris
Kris12mo ago
Why are you trying to avoid parallels? It's been really good for me. Just curious.
Stef
Stef12mo ago
money, and i do have a windows machine, its just a desktop
Kris
Kris12mo ago
Ahhh
Stef
Stef12mo ago
and ive been enjoying using a laptop
Kris
Kris12mo ago
Damn this suggestion is going to suck, why not just remote to your windows machine?
Pobiega
Pobiega12mo ago
doesnt suck too much, thats literally how I work from home 😄
Stef
Stef12mo 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
Pobiega12mo ago
I just remotecontrol my work computer
Stef
Stef12mo ago
isnt the delay gonna be horrible and my desktop has to always be on
Pobiega
Pobiega12mo ago
delay? 5 ms isnt too much and yes, the desktop needs to be on.
Stef
Stef12mo ago
what program should i use i might try that
Pobiega
Pobiega12mo 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
Stef12mo ago
aight g, thnx for everything
Kris
Kris12mo ago
GL!
Stef
Stef12mo ago
tyty its been helpful
Accord
Accord12mo 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
Stef12mo ago
/close
Want results from more Discord servers?
Add your server
More Posts
❔ new to programming and can't figure outi want to create an appointment scheduler that let's the user create view update and delete but can'❔ ✅ (SOLVED) TcpListener.AcceptTcpClientAsync does not get cancelled```csharp CancellationTokenSource cancel = new(400); TcpClient JoinedClient = await Server.AcceptTc✅ Tracking changes on a complex object provided by a third party libraryHi! I have a third party .Net Framework dll that allows me to load a file. This file is potentially ❔ ✅ How I can fix download and unzipI wrote a code to download the archive and unpack it but it just creates empty files instead of deco❔ Error message: Cannot convert query to sqlhi i have this code, on line 119 is whats causing the error saying the query cannot be converted to Make a method acessable by scripts extending it, but not by outside scriptsI have private which limits a method to itself, and I have public which lets anything access the metOk so i DID NOT add hello world to my code but it still appearsmy code for some ungodly reason has decided to not use my code and use a previous code when i run an❔ Problem with Quick SortIt seems that it partially sorts it and doesn't finish. I really can't see what is wrong ``` void Qu"name space 'helloworld2' already contains a definition for a 'program'Man this my first code ever in c# it worked two seconds ago and now it dont what do i do pls heres t❔ Windows forms C#Issue with forms resizing when maximizing the window, how do i get rid if the empty space?