连接远程SQL Server DB [英] Connecting with remote SQL Server DB
问题描述
您好,
互联网浏览建议我使用连接字符串来访问连接到远程SQL服务器的远程数据库。
Hello,
Internet browsing has suggested me following connection string to access remote DB, attached to remote SQL server.
"Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;"
< br $> b $ b
我想通过互联网访问数据库,而不是通过局域网访问数据库。我的问题是关于IP地址和端口。
1)我应该使用什么IP地址而不是190.190.200.100?我的意思是我怎么知道我的服务器有什么IP地址。
2)如何检查我的服务器使用的端口?它总是1433吗?
谢谢
<小> 代码块已修复[/ edit]
I want to access the DB over internet, not over LAN. My question is about the IP address and port.
1)What IP address I should use instead of 190.190.200.100? I mean how I can know what IP address my server has.
2) How to check the what port my server is using? Is it always 1433?
Thanks
[edit]Code block fixed[/edit]
推荐答案
1)获取服务器的外部IP地址: a href =http://www.whatismyip.com> www.whatismyip.com
2)创建虚拟服务器或/和配置ADSL调制解调器和防火墙上的端口转发。
1) Get your external IP address for your server with : www.whatismyip.com
2) Create a virtual server or/and configure port forwarding on your ADSL modem and firewall.
<connectionStrings>
<add name="ConnectionName" connectionString="Data Source=Server;Initial Catalog=DBNAME;User ID=USERID;Password=PASSWORD; >
</connectionStrings>
服务器:服务器名称,获取服务器IP,您需要在此处提供IP。
数据库将被连接。
Server: Server Name, Get the Server IP and you need to give that IP here.
DB will be connected.
这篇关于连接远程SQL Server DB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!