Configure SQL Server And Connect DB Engine From Another PC

This article is a continuation of my previous article and I have provided a link 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.

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

 

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

 

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

 

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.

 

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.

 

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

 

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.

 

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

 
 

Now, expand the inbound security rules. 

 

Click Add.

 

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 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.

 

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

 

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.

 

Select SQL Server authentication in an authentication box.

Provide the login name and password. Click Connect.

 

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.