Forum Discussion
How to link SQL Server drivers to iODBC on mac?
I just started running SQL Server on a Mac with Apple Silicon, using these instructions. It runs inside a Docker instance, which runs inside Ubuntu with x86_64 emulation, inside of macOS by way of Parallels. I am able to connect SSMS to the server instance, restore database backups, and run views.
One application I use can only connect to SQL Server via ODBC. It needs either a DSN or a connection string. On a Windows PC, I use DSN's, so that's what I'm familiar with. But that's also where I am stuck.
It seems that I should install the SQL Server driver 18 and install iODBC for macOS. I have struggled to get iODBC to find an use the drivers. After a lot of head-scratching, I determined that the driver appears to be installed to
/opt/homebrew/Cellar/msodbcsql18/18.4.1.1/lib/libmsodbcsql.18.dylib. In iODBC, I clicked on the "ODBC Drivers" tab, then "Add a driver", and pasted the above path into "Driver file name". I gave the driver a name, left the "setup file name" blank (I don't know what that is) and clicked OK. I got a "general installer error." Screenshots are below.
So I am stuck. How is one supposed to use this SQL Server ODBC driver for macOS? How does one construct a DNS? Or what should the connection string look like? Thank you.
- Hello
I'll suggest you to verify that you have sql connectivity from outside Docker/sql container. Basically install Azure Data Studio https://learn.microsoft.com/en-us/azure-data-studio/download-azure-data-studio and try to connect to the sql instance within the container , so with that you are 100% sure that connectivity is fine. Make sure that it publish TCP port 1433
Regards
Javier- DavidR20Copper Contributor
Javier_Villegas As I wrote above, I did that: "I am able to connect SSMS to the server instance"