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
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.
Part 2 Configuring Windows Firewall
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:
From the Customize Service Settings under Apply to this service select database engine instance service, search your SQL and click the OK button.
Then click the Next. In “Protocol and Ports”:
– Protocol type: TCP
– Local Port: Specific Ports -> 1433
– Remote port: Do not change anything
In Scope, we need to Whitelist our IP: 188.8.131.52.
At the bottom, click on “These IP address:”, then on “Add”, and in “This IP address or subnet:” write 184.108.40.206 and clic OK.
Click Next, Next, and Next.
Give the rule a name and click Finish.
Part 3 Enable port forwarding and connect
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
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.