Quantcast
Channel: CodeSection,代码区,SQL Server(mssql)数据库 技术分享 - CodeSec
Viewing all articles
Browse latest Browse all 3160

Connect SQL Server on Linux with SSMS from a Windows machine

$
0
0
In [ previous post ] we saw how to install & setup SQL Server on linux . We used PuTTY to connect to the Linux Azure VM and query SQL Server there.

Here in this post we will try to connect to SQL Server on Linux via SSMS from a windows machine.

So to connect remotely to SQL Server on an Azure VM , you have to configure an inbound rule on the network security group. The rule allows traffic on the port on which SQL Server listens (default is 1433).

> Setup Inbound Rule:

1. You need to go to portal.azure.com and login with your credentials. On the Dashboard you will see your Linux VM as shown below:


Connect SQL Server on Linux with SSMS from a Windows machine

2. Click on the Linux VM widget, it will open up and list out the Settings, click on Network Interfaces , and select the available Network Interface from the list.


Connect SQL Server on Linux with SSMS from a Windows machine

3. Now click on the Network Security Group :


Connect SQL Server on Linux with SSMS from a Windows machine

4. On the Network Security Group page, select the Inbound security rules , and click on the “+” button create new for SQL Server:


Connect SQL Server on Linux with SSMS from a Windows machine

5. On the Add inbound security rule page, provide a name to this rule, select “MS SQL” under Service drop-down, and click OK:


Connect SQL Server on Linux with SSMS from a Windows machine
> Connect using SSMS:

6. Now from any Remote machine or even you PC which has SSMS installed and have internet connection, try connecting the SQL Server Linux Instance:

Server Name:provide the IP address of the Linux VM (you can get it by opening the “Linux VM widget” and clicking on “Connect” button at top)

Authentication:should be SQL Server Authentication

Login:“SA”

Password:apply the same password that you set it up while Configuring SQL Server on Linux.


Connect SQL Server on Linux with SSMS from a Windows machine

7. On successful authentication you will see the Object Explorer showing the SQL instance that’s running on a Linux machine. On a glance you can’t make out any difference b/w a Linux SQL instance or a Windows SQL instance.

Thus I executed the SELECT @@version statement which shows the SQL Server version and on which Operating system its running.

You can even see the Database SQLdbOnLinux that we created by connecting from the PuTTY client.


Connect SQL Server on Linux with SSMS from a Windows machine

That’s it for now, will write more about SQL on Linux on coming updates from Microsoft !!!


Viewing all articles
Browse latest Browse all 3160

Latest Images

Trending Articles