0

我一直在尝试将我的 sql server express 2012 配置为通过 Internet 接收连接数小时而没有任何运气(我正在使用 Team Foundation Service 进行夜间构建,但是当它尝试运行与 sql server 交互的单元测试时它失败了)。

我一直得到的是这条消息:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

为了解决这个问题,我尝试了以下方法:

  1. 安装并运行 SQL Server Browser
  2. 为 sql server 实例启用 TCP/IP(使用默认 SQLEXPRESS)
  3. 在我的路由器中启用端口转发
  4. 将 SQL Server 和 SQL Server 浏览器应用添加到防火墙允许的应用列表中。
  5. 把我的头撞在墙上。

我的sql server是混合模式,用户名密码正确(使用本地ip时有效)

我已经阅读了关于这个问题的每一篇文章,但到目前为止还没有..

我很绝望,所以任何建议将不胜感激!

谢谢

4

1 回答 1

2

解决了。

只需要输入我的公共 IP 地址而不输入实例名称。

例如 xxx.xxx.xxx.xxx 而不是 xxx.xxx.xxx.xxx\SQLEXPRESS

我不敢相信这是一个愚蠢的错误......

于 2013-04-20T22:24:46.313 回答