如何连接不在同一个局域网的sql数据库
我正在尝试连接到 sql server 2005 数据库。不在同一个局域网内。我遇到错误,就像
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)
在本地 LAN 中一样,我可以使用“IP &”进行连接。 TCP\IP 端口号' 和'实例名称'
有没有解决方案
I am trying to connect to sql server 2005 database. It's not in the same LAN. I am Getting error like
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)
in local LAN i am able to connect with using 'IP & TCP\IP port number' and 'instance name'
is there any solution for this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您是否在 SQL Server 中启用了远程连接?
请参阅 Microsoft 撰写的此知识库文章“如何配置 SQL Server 2005 以允许远程连接”
Did you enable remote connections in SQL Server?
See this KB article by Microsoft "How to configure SQL Server 2005 to allow remote connections"
与您的网络管理员联系 - 您似乎没有从您所在的网络位置到该子网的路由,或者流量被防火墙阻止,或者您的连接字符串中的端口或 IP 不正确。
Talk to your network administrator - you don't seem have a route to that subnet from where you are on the network, OR the traffic is being block by a firewall, OR you have an incorrect port or IP in your connection string.
可能不是“不在您的局域网中”,而是“您的网络无法访问”。差异很大,无需任何额外信息,您就能得到答案。
确保您可以首先建立基本的网络连接(例如,PING 或 telnet 到端口以查看其是否打开)。它可以是告诉你迷路的防火墙。
Probably it is not "not in your LAN" but "not reachable by your network". There is a high difference and without any additional information that is as good as you will get an answer.
Make sure you can establish a basic network connection first (i.e. for example PING or telnet to the port to see that it opens). It can be a firewall between telling you to get lost.
造成这种情况的原因可能有很多。
远程 SQL Server 位于防火墙后面/流量未正确路由/sql server 上未启用远程访问/服务器端软件防火墙等。
您可能应该查找一些有关如何设置 Windows Server + MS SQL 进行远程连接的教程。
There can be lots of reasons for this.
The remote SQL Server is behind a firewall / traffic not routed properly / remote access is not enabled on the sql server / serverside software firewall etc.
You should probably lookup some tutorial on how to setup a Windows Server + MS SQL for remote connections.