How to connect SQL Server through Internet

How to connect SQL Server through Internet

 

Do you have your SQL Server database locally and want to be able to connect to it from the Internet?

Nothing easier, follow these three parts.

 


 

Part 1  SQL Server Configuration Manager

Screen Shot 2019-03-05 at 12.38.02

 

Open the SQL Server Configuration Manager in the Configuration Tools folder

under the Microsoft SQL Server folder.

From the SQL Server Network Configuration node, select the Protocols item for the appropriate SQL Server.

Your TCP/IP must be Enable.

In the “Properties” of TCP / IP, all the way down in the IPAII tab, the TCP Port must be 1433.

 

In order for the changes take effect, from console pane, select the SQL Server Services and from the details pane, right click the SQL Server (Your SQL) database engine instance and click the Restart option.

And on the same console pane, make sure SQL Browser is enabled and running.

Screen Shot 2019-03-13 at 9.52.49

 

 

 

Part 2  Configuring Windows Firewall

 

word-image-15


From the Control Panel choose Windows Firewall and click the Advanced settings or just type wf.msc in Search program and files from the Start menu.

In the Windows Firewall with Advanced Security, click the Inbound Rules from the left pane, right click Inbound Rules and select the New Rule or from the Actions pane click the New Rule.

And from the Rule Type select the Custom rule.

In the Program under the Services click the Customize button:

word-image-22

 

From the Customize Service Settings under Apply to this service select database engine instance service, search your SQL and click the OK button.

Screen Shot 2019-03-13 at 10.33.34

Then click the Next. In “Protocol and Ports”:
– Protocol type: TCP
– Local Port: Specific Ports -> 1433
– Remote port: Do not change anything
Screen Shot 2019-03-18 at 12.04.39

Click Next.
In Scope, we need to Whitelist our IP: 52.16.248.224.
At the bottom, click on “These IP address:”, then on “Add”, and in “This IP address or subnet:” write 52.16.248.224 and clic OK.

Screen Shot 2019-03-18 at 12.12.39

Click Next, Next, and Next.
Give the rule a name and click Finish.

 

 

Part 3 Enable port forwarding and connect

Screen Shot 2019-03-06 at 15.09.49

1  Create a new port forwarding

Each router is different. But the goal is the same: Enable the Port Forwarding on your router.

To do this, you need to :
Login to your router
Search WAN Services
And create Port forwarding with this informations:
   • Name : Name for this rule (example SQLExpose)
   • Protocole: TCP/UDP
   • WAN port: 1433
   • LAN port: 1433
   • Destination IP: Your local IP adresse

 

Screen Shot 2019-03-06 at 15.28.14

 

2  Login to your database

In Host, you have to write your public IP address.

In Database Name, the name of your SQL Database.

Port 1433, as we have seen previously.

Then you have to write the User and Password to access your SQL database.
Click Connect