如何通过IP连接SQL Server

发布于 2024-08-03 12:07:28 字数 186 浏览 3 评论 0原文

我有一个安装了 win2003 的远程服务器,

我可以使用远程桌面连接到该计算机,并成功在该服务器上托管一个 Web 应用程序,

我需要使用我拥有的 sql 比较工具连接到该计算机上的 SQL 服务器。

鉴于我所拥有的只是计算机的 IP 地址和管理员登录凭据,我需要采取哪些步骤才能连接到 SQL Server

I have a remote server that has win2003 installed

I can connect to the machine using remote desktop and am succesfully hosting a web app on the server

I need to connect to the SQL server on that machine using a sql compare tool that I have.

What are the steps that I need to take to be able to connect to the SQL server given that all I have is the IP address to the machine and admin login credentials

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

南渊 2024-08-10 12:07:28

如果您尝试使用 ssms 或另一台计算机上的另一个客户端远程连接到 sql server,您需要执行以下操作:

  • 在服务器防火墙上打开 sqlservr
  • 在服务器防火墙上打开 sqlbrowsr
  • 关心安全 - 如果您可以 rdp/connect到 sql w/o vpn,那么其他人也可以 - 所以你最好确保你有强化的环境和非常强的密码。

if you are trying to remotely connect to sql server using ssms or another client on a different machine, you need to do the following:

  • open up sqlservr on server firewall
  • open up sqlbrowsr on server firewall
  • be concerned about security - if you can rdp/connect to sql w/o vpn, then so can other people - so you better make sure you have hardened environment and very strong passwords.
酷到爆炸 2024-08-10 12:07:28

根据具体的访问技术,需要不同的连接字符串语法。对于 .NET 提供程序,语法允许传递服务器地址。

Depending on the specific access technology, different syntaxes for connection strings are needed. For the .NET provider, the syntax allows for passing server addresses.

最初的梦 2024-08-10 12:07:28

下面是 ADO.net 连接的示例连接。

imports System.Data.SqlConnection
...
dim cn as new SqlConnection()
cn.connectionString = "Server=192.168.1.200;Database=mydbName;user id=notSA;password=C0mp!3xPVVD"
cn.open()
...
'Do cool stuff
...
cn.close()

Here's a sample connection ADO.net connection.

imports System.Data.SqlConnection
...
dim cn as new SqlConnection()
cn.connectionString = "Server=192.168.1.200;Database=mydbName;user id=notSA;password=C0mp!3xPVVD"
cn.open()
...
'Do cool stuff
...
cn.close()
我早已燃尽 2024-08-10 12:07:28

在远程服务器上打开端口 TCP 1433 (Sql Server)
对于您的连接字符串,只需使用服务器的 IP 地址,而不是使用计算机名称。

您应该能够毫无问题地在计算机名称和 IP 地址之间互换,因为计算机名称无论如何都会变成 IP 地址。

Open up port TCP 1433 (Sql Server) on the remote server
And for your connection string jus use the IP Address for the Server, instead of using the computer name

You should be able to interchange between computer name and IP address without any problems, because the Computer Name gets turned into an IP Address anyway.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文