简体   繁体   中英

Windows Service connection to SQL Server over internet

I have created a windows service and want to connect to SQL server 2008 over internet. The issue is that although I can connect it locally and with the local IP, my server is behind a firewall. Since there is a Sharepoint server on the web on the same server, I know that the system is on the internet.

What should be the connection string to connect to the server from outside the local network and from anywhere in the world?

If it's behind a firewall, you'll have to open port 1433 to incoming traffic. Other than that, the connection string should be the same as the internal one, only using the external IP (if you don't know it: http://www.whatsmyip.org/ ). You'll need to make sure that mixed authentication is enabled, because of course you can't connect using Windows domain credentials over the internet.

I should probably mention it's not a very good practice to expose your SQL Server to the outside world ... but you know that, right?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM