SQLPro for MSSQL is the Premier application for editing and viewing SQL Server databases on mac os x. The Microsoft SQL Server Management Studio, shortly called as SSMS is a Flexible and most powerful tool to work with SQL Server. The SQL Server Management Studio is not the actual server, but it provides an opportunity to connect and work with SQL elegantly.
- Microsoft Sql Server Management Studio For Mac Windows 7
- Microsoft Sql Server Management Studio For Mac Installer
- Microsoft Sql Server Management Studio For Mac Free
- Microsoft Sql Management Studio Free
- Microsoft Sql Server Management Studio Macros
Prerequisites
Microsoft SQL Server 2017 (Express Edition) – download link from the Microsoft site
Microsoft SQL Server Management Studio 18.2 - download link from the Microsoft site
DataGrip 2019.1 and later – download link from the JetBrains site
Step 1. Configure the SQL Server Configuration Manager
To open SQL Server Configuration Manager, open the Search dialog on Windows and type SQLServerManager14.msc
(for Microsoft SQL Server 2017). Double-click the found result. If you use other versions of Microsoft SQL Server, change the second digit before .msc
:
SQLServerManager13.msc
for SQL Server 2016SQLServerManager12.msc
for SQL Server 2014SQLServerManager11.msc
for SQL Server 2012
Run the SQL Server Browser
SQL Server Browser listens for incoming requests and provides information about Microsoft SQL Server instances on the computer. For more information about SQL Server Browser, see SQL Server Browser in the Microsoft documentation.
If the SQL Server Browser menu items are disabled, try to enable the SQL Server Agent service.
In the SQL Server Configuration Manager, click SQL Server Services.
In the right pane that lists server services, right-click SQL Server Browser and select Start.
Enable SQL Server Agent
If the SQL Server Browser is running, you can skip this procedure.
SQL Server Agent is a Microsoft Windows service that executes scheduled administrative tasks. For more information about the service, see SQL Server Agent in the official Microsoft documentation. Ensure that SQL Server Agent is running and starts automatically. After the change, a restart might be required.
Navigate to Control Panel | Administrative Tools | Services.
In the Services window, right-click SQL Server Agent() and select Properties. For this tutorial, is MSSQLSERVER.
From the Startup type list, select Automatic and click Start.
Enable the TCP/IP connection
In the SQL Server Configuration Manager, expand SQL Server Configuration and click Protocols for MSSQLSERVER, where MSSQLSERVER is a name of the Microsoft SQL Server instance.
In the list of protocol names, right-click TCP/IP and select Properties.
On the Protocol tab, from the Enabled list, select Yes.
On the IP Addresses tab, find the interface that your workstation uses and see the connection port. By default, the port is 1433. Verify that other running applications do not use the same port.
If you changed any settings, restart the server. For most situations, the restart resolves connection problems.
Step 2. Configure SQL Server Management Studio (SSMS)
Create a user
In the SQL Server Management Studio (SSMS), navigate to Security | Logins.
Right-click the Logins root folder and select New Login.
On the General page, specify a login name in the Login name field.
Select authentication mode. You can select between the following authentication modes:
Windows authentication: to use your domain login and password.
SQL Server authentication: to use a custom login and password. If you select Enforce password security policy checkbox, the user must change the assigned password before connecting to Microsoft SQL Server with DataGrip. Otherwise, clear the Enforce password security policy checkbox.
Click OK.
Configure user roles
Right-click the created user profile and select Properties.
On the Server Roles page, select the appropriate user role (for example, sysadmin).
Step 3. Connect to Microsoft SQL Server with DataGrip
The following section describes configuration of DataGrip on Windows, macOS, and Linux. Note that the Use Windows domain authentication checkbox is available only on Windows. To configure Windows domain authentication on macOS and Linux, see Connect by using Windows domain authentication.
Windows
Microsoft Sql Server Management Studio For Mac Windows 7
Connect by using SQL Server authentication
Navigate to File | Data Sources or press Ctrl+Alt+Shift+S.
In the Data Sources and Drivers dialog, click the Add icon () and select Microsoft SQL Server.
Click the Driver link and select Microsoft SQL Server (jTds).
At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
In Host, Instance, and Port fields, specify your connection details.
From the Authentication list, select User and Password.
In User and Password fields, specify your credentials.
To ensure that the connection to the data source is successful, click Test Connection.
Connect by using single sign-on for Microsoft SQL Server
If you run DataGrip on Windows in the same domain as the Microsoft SQL Server database, you can use the Single-Sign On (SSO).
Navigate to File | Data Sources or press Ctrl+Alt+Shift+S.
In the Data Sources and Drivers dialog, click the Add icon () and select Microsoft SQL Server.
Click the Driver link and select Microsoft SQL Server (jTds).
At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
From the Authentication list, select Windows credentials.
To ensure that the connection to the data source is successful, click Test Connection.
Connect by using Windows domain authentication
Navigate to File | Data Sources or press Ctrl+Alt+Shift+S.
In the Data Sources and Drivers dialog, click the Add icon () and select Microsoft SQL Server.
Click the Driver link and select Microsoft SQL Server (jTds).
At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
In Host, Instance, and Port fields, specify your connection details.
From the Authentication list, select Domain credentials.
In the Domain field, specify the domain (for example,
DEVELOPMENT
).In User and Password fields, specify your domain credentials. In the User field, type your domain user without the domain prefix (for example,
John.Smith
instead ofDOMAINJohn.Smith
).Alternatively, on the General tab, specify the connection string. Consider the following example of a full connection string:
jdbc:jtds:sqlserver://UNIT-670:1433;domain=DEVELOPMENT;instance=MSSQLSERVER;databaseName=guest;To ensure that the connection to the data source is successful, click Test Connection.
macOS and Linux
Connect by using SQL Server authentication
Navigate to File | Data Sources or press ⌘;.
In the Data Sources and Drivers dialog, click the Add icon ( ) and select Microsoft SQL Server.
Click the Driver link and select Microsoft SQL Server (jTds).
At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
In Host, Instance, and Port fields, specify your connection details.
From the Authentication list, select User and Password.
In User and Password fields, specify your credentials.
To ensure that the connection to the data source is successful, click Test Connection.
Connect by using Windows domain authentication
Navigate to File | Data Sources or press ⌘;.
In the Data Sources and Drivers dialog, click the Add icon ( ) and select Microsoft SQL Server.
Click the Driver link and select Microsoft SQL Server (jTds).
At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
In Host, Instance, and Port fields, specify your connection details.
From the Authentication list, select Domain credentials.
In the Domain field, specify the domain (for example,
DEVELOPMENT
).In User and Password fields, specify your domain credentials. In the User field, type your domain user without the domain prefix (for example,
John.Smith
instead ofDOMAINJohn.Smith
).Alternatively, on the General tab, specify the connection string. Consider the following example of a full connection string:
jdbc:jtds:sqlserver://UNIT-670:1433;domain=DEVELOPMENT;instance=MSSQLSERVER;databaseName=guest;To ensure that the connection to the data source is successful, click Test Connection.
I previously explained how to install SQL Server on a Mac via a Docker container. When I wrote that, SQL Server 2017 was the latest version of SQL Server, and it had just been made available for Linux and Docker (which means that you can also install it on MacOS systems).
In late 2018, Microsoft announced SQL Server 2019 Preview, and subsequently announced general release in late 2019. The installation process for SQL Server 2019 is exactly the same as for SQL Server 2017. The only difference is that you need to use the container image for SQL Server 2019 instead of the 2017 image. Here I show you how to do that.
Also, if you already have SQL Server 2017 installed, and you want to install SQL Server 2019 without removing the 2017 version, you'll need to allocate a different port number on your host. I show you how to do that too.
Docker
The first step is to install Docker. If you already have Docker installed you can skip this step (and jump straight to SQL Server).
Docker is a platform that enables software to run in its own isolated environment. Therefore, SQL Server 2019 can be run on Docker in its own isolated container.
Install Docker
To download, visit the Docker CE for Mac download page and click Get Docker.
To install, double-click on the .dmg file and then drag the Docker.app icon to your Application folder.
Launch Docker
Launch Docker the same way you'd launch any other application (eg, via the Applications folder, the Launchpad, etc).
When you open Docker, you might be prompted for your password so that Docker can install its networking components and links to the Docker apps. Go ahead and provide your password, as Docker needs this to run.
Increase the Memory (optional)
By default, Docker will have 2GB of memory allocated to it. I'd suggest increasing it to 4GB if you can.
To do this, select Preferences from the little Docker icon in the top menu:
Then finish off by clicking Apply & Restart
SQL Server
Now that Docker has been installed and configured, we can download and install SQL Server 2019.
Microsoft Sql Server Management Studio For Mac Installer
Download SQL Server 2019
Open a Terminal window and run the following command.
This downloads the latest SQL Server for Linux Docker image to your computer.
You can also check for the various container image options on the Docker website if you wish.
Launch the Docker Image
Run the following command to launch an instance of the Docker image you just downloaded:
Just change
Bart
to a name of your choosing, andreallyStrongPwd#123
to a password of your choosing.If you get a 'port already allocated' error, see below.
Here's an explanation of the parameters:
-e 'ACCEPT_EULA=Y'
- The
Y
shows that you agree with the EULA (End User Licence Agreement). This is required. -e 'SA_PASSWORD=reallyStrongPwd#123'
- Required parameter that sets the
sa
database password. -p 1433:1433
- This maps the local port 1433 to port 1433 on the container. The first value is the TCP port on the host environment. The second value is the TCP port in the container.
--name Bart
- Another optional parameter. This parameter allows you to name the container. This can be handy when stopping and starting your container from the Terminal. You might prefer to give it a more descriptive name like
sql_server_2019
or similar. -d
- This optional parameter launches the Docker container in daemon mode. This means that it runs in the background and doesn't need its own Terminal window open. You can omit this parameter to have the container run in its own Terminal window.
mcr.microsoft.com/mssql/server:2019-latest
- This tells Docker which image to use.
Password Strength
You need to use a strong password. Microsoft says this about the password:
The password should follow the SQL Server default password policy, otherwise the container can not setup SQL server and will stop working. By default, the password must be at least 8 characters long and contain characters from three of the following four sets: Uppercase letters, Lowercase letters, Base 10 digits, and Symbols.
Error – 'Port already allocated'?
If you get an error that says something about 'port is already allocated', then perhaps you already have SQL Server installed on another container that uses that port. In this case, you'll need to map to a different port on the host.
Therefore, you could change the above command to something like this:
In this case I simply changed
-p 1433:1433
to-p 1400:1433
. Everything else remains the same.You may now get an error saying that you need to remove the existing container first. To do that, run the following (but swap
Bart
with the name of your own container):Once removed, you can try running the previous command again.
Note that if you change the port like I've done here, you will probably need to include the port number when connecting to SQL Server from any database tools from your desktop. For example, when connecting via the Azure Data Studio (mentioned below), you can connect by using
Localhost,1400
instead of justLocalhost
. Same with mssql-cli, which is a command line SQL tool.
Check Everything
Navigate to Control Panel | Administrative Tools | Services.
In the Services window, right-click SQL Server Agent() and select Properties. For this tutorial, is MSSQLSERVER.
From the Startup type list, select Automatic and click Start.
Enable the TCP/IP connection
In the SQL Server Configuration Manager, expand SQL Server Configuration and click Protocols for MSSQLSERVER, where MSSQLSERVER is a name of the Microsoft SQL Server instance.
In the list of protocol names, right-click TCP/IP and select Properties.
On the Protocol tab, from the Enabled list, select Yes.
On the IP Addresses tab, find the interface that your workstation uses and see the connection port. By default, the port is 1433. Verify that other running applications do not use the same port.
If you changed any settings, restart the server. For most situations, the restart resolves connection problems.
Step 2. Configure SQL Server Management Studio (SSMS)
Create a user
In the SQL Server Management Studio (SSMS), navigate to Security | Logins.
Right-click the Logins root folder and select New Login.
On the General page, specify a login name in the Login name field.
Select authentication mode. You can select between the following authentication modes:
Windows authentication: to use your domain login and password.
SQL Server authentication: to use a custom login and password. If you select Enforce password security policy checkbox, the user must change the assigned password before connecting to Microsoft SQL Server with DataGrip. Otherwise, clear the Enforce password security policy checkbox.
Click OK.
Configure user roles
Right-click the created user profile and select Properties.
On the Server Roles page, select the appropriate user role (for example, sysadmin).
Step 3. Connect to Microsoft SQL Server with DataGrip
The following section describes configuration of DataGrip on Windows, macOS, and Linux. Note that the Use Windows domain authentication checkbox is available only on Windows. To configure Windows domain authentication on macOS and Linux, see Connect by using Windows domain authentication.
Windows
Microsoft Sql Server Management Studio For Mac Windows 7
Connect by using SQL Server authentication
Navigate to File | Data Sources or press Ctrl+Alt+Shift+S.
In the Data Sources and Drivers dialog, click the Add icon () and select Microsoft SQL Server.
Click the Driver link and select Microsoft SQL Server (jTds).
At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
In Host, Instance, and Port fields, specify your connection details.
From the Authentication list, select User and Password.
In User and Password fields, specify your credentials.
To ensure that the connection to the data source is successful, click Test Connection.
Connect by using single sign-on for Microsoft SQL Server
If you run DataGrip on Windows in the same domain as the Microsoft SQL Server database, you can use the Single-Sign On (SSO).
Navigate to File | Data Sources or press Ctrl+Alt+Shift+S.
In the Data Sources and Drivers dialog, click the Add icon () and select Microsoft SQL Server.
Click the Driver link and select Microsoft SQL Server (jTds).
At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
From the Authentication list, select Windows credentials.
To ensure that the connection to the data source is successful, click Test Connection.
Connect by using Windows domain authentication
Navigate to File | Data Sources or press Ctrl+Alt+Shift+S.
In the Data Sources and Drivers dialog, click the Add icon () and select Microsoft SQL Server.
Click the Driver link and select Microsoft SQL Server (jTds).
At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
In Host, Instance, and Port fields, specify your connection details.
From the Authentication list, select Domain credentials.
In the Domain field, specify the domain (for example,
DEVELOPMENT
).In User and Password fields, specify your domain credentials. In the User field, type your domain user without the domain prefix (for example,
John.Smith
instead ofDOMAINJohn.Smith
).Alternatively, on the General tab, specify the connection string. Consider the following example of a full connection string:
jdbc:jtds:sqlserver://UNIT-670:1433;domain=DEVELOPMENT;instance=MSSQLSERVER;databaseName=guest;To ensure that the connection to the data source is successful, click Test Connection.
macOS and Linux
Connect by using SQL Server authentication
Navigate to File | Data Sources or press ⌘;.
In the Data Sources and Drivers dialog, click the Add icon ( ) and select Microsoft SQL Server.
Click the Driver link and select Microsoft SQL Server (jTds).
At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
In Host, Instance, and Port fields, specify your connection details.
From the Authentication list, select User and Password.
In User and Password fields, specify your credentials.
To ensure that the connection to the data source is successful, click Test Connection.
Connect by using Windows domain authentication
Navigate to File | Data Sources or press ⌘;.
In the Data Sources and Drivers dialog, click the Add icon ( ) and select Microsoft SQL Server.
Click the Driver link and select Microsoft SQL Server (jTds).
At the bottom of the data source settings area, click the Download missing driver files link. Alternatively, you can specify user drivers for the data source. For more information about user drivers, see Add a user driver to an existing connection.
In Host, Instance, and Port fields, specify your connection details.
From the Authentication list, select Domain credentials.
In the Domain field, specify the domain (for example,
DEVELOPMENT
).In User and Password fields, specify your domain credentials. In the User field, type your domain user without the domain prefix (for example,
John.Smith
instead ofDOMAINJohn.Smith
).Alternatively, on the General tab, specify the connection string. Consider the following example of a full connection string:
jdbc:jtds:sqlserver://UNIT-670:1433;domain=DEVELOPMENT;instance=MSSQLSERVER;databaseName=guest;To ensure that the connection to the data source is successful, click Test Connection.
I previously explained how to install SQL Server on a Mac via a Docker container. When I wrote that, SQL Server 2017 was the latest version of SQL Server, and it had just been made available for Linux and Docker (which means that you can also install it on MacOS systems).
In late 2018, Microsoft announced SQL Server 2019 Preview, and subsequently announced general release in late 2019. The installation process for SQL Server 2019 is exactly the same as for SQL Server 2017. The only difference is that you need to use the container image for SQL Server 2019 instead of the 2017 image. Here I show you how to do that.
Also, if you already have SQL Server 2017 installed, and you want to install SQL Server 2019 without removing the 2017 version, you'll need to allocate a different port number on your host. I show you how to do that too.
Docker
The first step is to install Docker. If you already have Docker installed you can skip this step (and jump straight to SQL Server).
Docker is a platform that enables software to run in its own isolated environment. Therefore, SQL Server 2019 can be run on Docker in its own isolated container.
Install Docker
To download, visit the Docker CE for Mac download page and click Get Docker.
To install, double-click on the .dmg file and then drag the Docker.app icon to your Application folder.
Launch Docker
Launch Docker the same way you'd launch any other application (eg, via the Applications folder, the Launchpad, etc).
When you open Docker, you might be prompted for your password so that Docker can install its networking components and links to the Docker apps. Go ahead and provide your password, as Docker needs this to run.
Increase the Memory (optional)
By default, Docker will have 2GB of memory allocated to it. I'd suggest increasing it to 4GB if you can.
To do this, select Preferences from the little Docker icon in the top menu:
Then finish off by clicking Apply & Restart
SQL Server
Now that Docker has been installed and configured, we can download and install SQL Server 2019.
Microsoft Sql Server Management Studio For Mac Installer
Download SQL Server 2019
Open a Terminal window and run the following command.
This downloads the latest SQL Server for Linux Docker image to your computer.
You can also check for the various container image options on the Docker website if you wish.
Launch the Docker Image
Run the following command to launch an instance of the Docker image you just downloaded:
Just change
Bart
to a name of your choosing, andreallyStrongPwd#123
to a password of your choosing.If you get a 'port already allocated' error, see below.
Here's an explanation of the parameters:
-e 'ACCEPT_EULA=Y'
- The
Y
shows that you agree with the EULA (End User Licence Agreement). This is required. -e 'SA_PASSWORD=reallyStrongPwd#123'
- Required parameter that sets the
sa
database password. -p 1433:1433
- This maps the local port 1433 to port 1433 on the container. The first value is the TCP port on the host environment. The second value is the TCP port in the container.
--name Bart
- Another optional parameter. This parameter allows you to name the container. This can be handy when stopping and starting your container from the Terminal. You might prefer to give it a more descriptive name like
sql_server_2019
or similar. -d
- This optional parameter launches the Docker container in daemon mode. This means that it runs in the background and doesn't need its own Terminal window open. You can omit this parameter to have the container run in its own Terminal window.
mcr.microsoft.com/mssql/server:2019-latest
- This tells Docker which image to use.
Password Strength
You need to use a strong password. Microsoft says this about the password:
The password should follow the SQL Server default password policy, otherwise the container can not setup SQL server and will stop working. By default, the password must be at least 8 characters long and contain characters from three of the following four sets: Uppercase letters, Lowercase letters, Base 10 digits, and Symbols.
Error – 'Port already allocated'?
If you get an error that says something about 'port is already allocated', then perhaps you already have SQL Server installed on another container that uses that port. In this case, you'll need to map to a different port on the host.
Therefore, you could change the above command to something like this:
In this case I simply changed
-p 1433:1433
to-p 1400:1433
. Everything else remains the same.You may now get an error saying that you need to remove the existing container first. To do that, run the following (but swap
Bart
with the name of your own container):Once removed, you can try running the previous command again.
Note that if you change the port like I've done here, you will probably need to include the port number when connecting to SQL Server from any database tools from your desktop. For example, when connecting via the Azure Data Studio (mentioned below), you can connect by using
Localhost,1400
instead of justLocalhost
. Same with mssql-cli, which is a command line SQL tool.
Check Everything
Now that we've done that, we should be good to go. Let's go through and run a few checks.
Check the Docker container (optional)
You can type the following command to check that the Docker container is running.
In my case I get this:
This tells me that I have two docker containers up and running: one called Bart and the other called Homer.
Connect to SQL Server
Here we use the SQL Server command line tool called 'sqlcmd' inside the container to connect to SQL Server.
Enter your password if prompted.
Now that you're inside the container, connect locally with sqlcmd:
This should bring you to the sqlcmd prompt 1>.
Run a Quick Test
Run a quick test to check that SQL Server is up and running. For example, check the SQL Server version by entering this:
This will bring you to a command prompt 2> on the next line. To execute the query, enter:
Result:
If you see a message like this, congratulations — SQL Server is now up and running on your Mac!
If you prefer to use a GUI to manage SQL Server, read on.
Azure Data Studio
Azure Data Studio is a free GUI management tool that you can use to manage SQL Server on your Mac. You can use it to create and manage databases, write queries, backup and restore databases, and more.
Azure Data Studio is available on Windows, Mac and Linux.
Microsoft Sql Server Management Studio For Mac Free
Here are some articles/tutorials I've written for Azure Data Studio:
Microsoft Sql Management Studio Free
Another Free SQL Server GUI – DBeaver
Another SQL Server GUI tool that you can use on your Mac (and Windows/Linux/Solaris) is DBeaver.
DBeaver is a free, open source database management tool that can be used on most database management systems (such as MySQL, PostgreSQL, MariaDB, SQLite, Oracle, DB2, SQL Server, Sybase, Microsoft Access, Teradata, Firebird, Derby, and more).
Microsoft Sql Server Management Studio Macros
I wrote a little introduction to DBeaver, or you can go straight to the DBeaver download page and try it out with your new SQL Server installation.