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

Configure SQL Server And Connect DB Engine From Another PC

$
0
0

This article is a continuation of my previous article and I have provided alink for that article. From this article, let’s see how to configure SQL Server for mixed mode for authority (authentications).

Prerequisites

An active Azure subscription with SQL Server 2016 SP1 running on windows Server.

SQL Server 2016 on your PC.

Configure SQL Server in mix mode authority

To connect to the database engine from another PC, we need to configure the mix mode authentication, where it leads to authentication of both SQL Server & Windows authentication.

Now, let’s get started

To connect to the virtual machine, click->start->SQL Server Management Studio.

In the connect to Server dialog box, enter the name of virtual machine in the Server name box and click Connect.


Configure SQL Server And Connect DB Engine From Another PC

From SQL Server Management Studio Window, Object Explorer right click->name of virtual machine SQL Server->click->Properties.


Configure SQL Server And Connect DB Engine From Another PC

From Security page and in Server authentication-> select SQL Server and Windows authentication mode. Click OK.


Configure SQL Server And Connect DB Engine From Another PC

The Server needs to be restarted. For this right click, VM SQL Server, click Restart.


Configure SQL Server And Connect DB Engine From Another PC
Creating SQL Server authentication rights

We need a minimum of one SQL Server authentication login for connecting DB from another PC.

In SQL Server Management Studio, right click security folder ->new->login.


Configure SQL Server And Connect DB Engine From Another PC

In login new dialog box, enter the name of the user and select SQL Server authentication. We need to provide the password for the user.

By providing the password enforcement option, we can select the enforce password policy and enforce password expiration. You can select the user who must change password at next login.

In the default DB, the master will be default and the language will be default.


Configure SQL Server And Connect DB Engine From Another PC

First time login- Go to Server roles, check sysadmin & click OK.


Configure SQL Server And Connect DB Engine From Another PC
Configuring network security for VM

We need to configure a rule for network security for the port for SQL Server. By default, the port is 1433.

From portal->select VM->select SQL Server VM & select network interfaces.


Configure SQL Server And Connect DB Engine From Another PC

Select the network interface of VM & click network security group link.


Configure SQL Server And Connect DB Engine From Another PC
Configure SQL Server And Connect DB Engine From Another PC

Now, expand the inbound security rules.


Configure SQL Server And Connect DB Engine From Another PC

Click Add.


Configure SQL Server And Connect DB Engine From Another PC

We must provide a name (I have selected the name as ServerSecurity).

Change to TCP protocol & check the action is set for allow.

Click OK to save in VM rules.


Configure SQL Server And Connect DB Engine From Another PC
Configure DNS label for IP address

We need to configure the IP address for DNS before connecting SQL Server DB.

For creating DNS->select-> VM in the portal & view its properties.

In VM, select the public IP address.


Configure SQL Server And Connect DB Engine From Another PC

Expand the configurations, enter the DNS name & it must be unique for connecting SQL Server VM ->click Save.


Configure SQL Server And Connect DB Engine From Another PC
Connecting the DB from another PC

On the PC->Start->SQL Server Management Studio.

In the Server name box, enter DNS name, which you entered of VM.


Configure SQL Server And Connect DB Engine From Another PC

Select SQL Server authentication in an authentication box.

Provide the login name and password. Click Connect.


Configure SQL Server And Connect DB Engine From Another PC

Thus we can connect. In my next article, I will explain how to move the data in SQL Server on VM and I hope, you learned something. Thank you.


Viewing all articles
Browse latest Browse all 3160

Latest Images

Trending Articles