How to Connect to SQL Server from a Mac (No SSMS Required)
Posted by Kyle Hankinson July 14, 2026
For years the stock answer to "how do I work with SQL Server?" was SQL Server Management Studio. That answer has never worked on a Mac: SSMS is Windows-only, and Microsoft has shown no sign of porting it. The usual fallback, Azure Data Studio, is gone too. Microsoft retired it on February 28, 2026, and it no longer receives updates or security fixes. We covered that retirement and the migration paths in an earlier post.
So what does a Mac developer actually use in 2026? There are three good options, and none of them involve a Windows VM. Everything below was tested from an Apple Silicon Mac against SQL Server 2022 (CU25).
Before you connect
Whichever tool you pick, you need the same four things:
- The server's hostname or IP address, and its port (1433 by default).
- Network reachability. Your Mac must be able to open a TCP connection to that port. If the server sits on a private network, that means a VPN or an SSH tunnel (covered below).
- Credentials: a SQL Server login and password, or Microsoft Entra ID for Azure SQL.
- One syntax quirk worth memorizing: SQL Server tools separate host and port with a comma, not a colon. It is
db.example.com,1433, neverdb.example.com:1433.
Option 1: sqlcmd in Terminal
Microsoft ships a modern, Go-based rewrite of its classic command-line tool, and it installs cleanly through Homebrew:
brew install sqlcmd
Connecting takes a server (-S), a login (-U), and a password (-P):
sqlcmd -S db.example.com,1433 -U sa -P 'YourStrongPassword'
That opens an interactive prompt where you type T-SQL and execute it with GO. For one-off commands, -Q runs a query and exits:
sqlcmd -S localhost,1433 -U sa -P 'YourStrongPassword' -Q "SELECT @@VERSION;"
One encryption detail to know up front. Most SQL Server installs, and every Docker test container, present a self-signed certificate. In my tests, go-sqlcmd connected to such a server without complaint, because by default it negotiates without validating the certificate. The moment you request encryption with -N, validation kicks in and the connection fails unless you either install a trusted certificate or pass -C (trust server certificate). The older ODBC-based sqlcmd, and most current GUI drivers, validate by default, which is where the widespread "certificate chain was issued by an authority that is not trusted" error comes from. The sqlcmd utility documentation spells out the flag behavior, including a heads-up that SQL Server 2025's sqlcmd makes encryption mandatory by default.
sqlcmd is the right tool for scripts, health checks, and CI. It is a poor place to read a 40-column result set.
Option 2: VS Code with the mssql extension
Microsoft's official recommendation after the Azure Data Studio retirement is the mssql extension for Visual Studio Code. Per Microsoft's documentation it covers query execution with IntelliSense, a results grid with export, object browsing, schema tools, and backup/restore operations, and existing Azure Data Studio queries and projects open in it without conversion.
It is free, and if you already live in VS Code it adds no new application to your dock. The tradeoffs are the ones you would expect from a database tool grafted onto a text editor: connection management, results, and object exploration all live inside VS Code's panel system, and the experience leans toward developers who primarily write application code and sometimes touch the database.
Option 3: a native Mac client
If SQL Server is where you spend a large part of your day, a purpose-built client is worth the money. SQLPro for MSSQL is a native client for macOS (with iOS and Windows versions) built specifically around SQL Server: a connection editor that exposes the encryption and certificate trust settings mentioned above, an object browser for databases, tables, and views, a query editor that handles multiple result sets from a single batch, result export to CSV, JSON, or XML, and built-in SSH tunneling so remote servers work without a manual tunnel.
The honest comparison: sqlcmd and the VS Code extension are free and official; a native client is commercial and, in exchange, treats the database as the main event rather than a sidebar. Plenty of developers use both a GUI for exploration and sqlcmd for automation.
Reaching a remote server: the SSH tunnel
Production databases should not expose port 1433 to the internet, and mostly they don't. If you can SSH into any machine that can reach the database, you can forward a local port through it:
ssh -L 11433:database-host:1433 you@jump-host.example.com
While that session stays open, your Mac's localhost,11433 behaves like the remote server's port 1433, and any of the three tools above can connect to it. Note the tunnel carries the database protocol as-is; whether the connection is encrypted end to end is still decided by the SQL Server driver settings.
The first-connection errors you are most likely to meet
- "The certificate chain was issued by an authority that is not trusted." The driver defaulted to encryption and the server presented a self-signed certificate. You either trust the certificate explicitly (the
-Cflag, or a trust checkbox in a GUI client) or put a proper CA-issued certificate on the server. - "Login failed for user" (error 18456). Wrong password, a login that doesn't exist, or a server configured for Windows authentication only. The client-side message is deliberately vague; the server's error log holds the specific reason.
- A long pause, then a timeout. TCP 1433 is not reachable: a firewall in the way, the wrong port, a named instance listening on a dynamic port, or a server with TCP/IP connections disabled. Test reachability first with
nc -z db.example.com 1433.
Summary
| Tool | Cost | Best for |
|---|---|---|
| sqlcmd (Homebrew) | Free | Scripts, automation, quick checks |
| VS Code mssql extension | Free | Developers already working in VS Code |
| Native Mac client | Paid | Daily database work, browsing, exports |
A Mac has been a perfectly good SQL Server workstation for a while now; the retirement of Azure Data Studio just changed which tools fill the gap. Pick the one that matches how much of your day the database occupies, and keep the comma-not-colon port syntax in mind for your first connection.
About the author — Kyle Hankinson is the founder and sole developer of SQLPro Studio and the Hankinsoft Development suite of database tools. He has been building native macOS and iOS applications since 2010.
Try SQLPro Studio — A powerful database manager for MySQL, PostgreSQL, Microsoft SQL Server, SQLite, Oracle, and Snowflake. Available on macOS, iOS, and Windows.
Download Free Trial View Pricing Compare