通过Internet访问本地服务器的SQL Server DB [英] Accessing SQL server DB of my local server over internet
问题描述
我的客户端正在使用我的SQL Sever应用程序,安装在他的一台本地计算机上的服务器,使用
Hi,
My client is using my SQL Sever application, sever installed on one of his local computers, dbs are being accessed using
connectionString="Data Source=Office1-MAIN-PC\EziBilling;Initial Catalog=dbBilling;User ID=sa"
现在一切都很好,现在他要求通过互联网访问连接到本地服务器的数据库。
我打算创建一个可以的客户端应用程序通过Internet连接到服务器实例。但是我不知道我应该使用什么连接字符串。
另外,我怎样才能得到服务器的IP地址(做没有静态IP)?
谢谢
By now everything is fine, now he demands to access the databases attached to local server, through internet too.
I am planning to create a client application that could connect to the server instance over internet. BUT I do not know what connection string I should use.
Also, how can I get the IP address of the server (do not have static IP)?
Thanks
推荐答案
通过SQL Server配置管理器配置服务器实例以允许TCP / IP协议。
SQL Server网络配置> [InstanceName]的协议>启用
您可以使用动态DNS服务来解析服务器的IP。
确保你打开服务器防火墙上的端口1433以允许传入连接。
要使用的连接字符串:
Hi,
Configure Server instance via SQL Server Configuration Manager to allow TCP/IP Protocols.
SQL Server Network Configuration > Protocol for [InstanceName] > Enable
You could use a Dynamic DNS Service to resolve the IP of the server.
Ensure you open up port 1433 on your Server firewall to allow incoming connections.
Connection string to be used:
connectionString=@"Data Source=\\ServerIPAddress\EziBilling;Initial Catalog=dbBilling;User ID=sa; Password=SomethingVerySecure"
注意:如果您打开SQL服务器,请确保您的sa帐户密码非常安全上网。
希望这有帮助......
Notes: Please ensure your sa account password is very secure, if you open up SQL server to the internet.
Hope this helps...
这篇关于通过Internet访问本地服务器的SQL Server DB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!