我无法连接到远程 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
在远程计算机上,SQL Server 正在运行并且端口 1433 已打开。
在我的 Visual Studio Server Explorer 中,与远程数据库的数据连接显示了一个小红叉。该州已关闭。 - 我在服务器名称选择字段中看不到远程电脑。但是我可以成功地ping远程计算机。
如何连接到服务器?
编辑:
我的连接字符串:{Data Source=wsbd0311\SQLEXPRESS;Initial Catalog=rms;User ID=sa;Password=mypassword}(我可以使用此 ID 和密码登录。)
我已经在远程 SQL Server 上设置了“允许远程连接到此服务器”。
编辑二:
我需要在远程 SQL Server 上打开端口 1434 吗?
请您参考如下方法:
确保服务器正在远程 PC 上运行。连接远程电脑,通过所有程序-> SQL Server -> SQL Server 配置管理器-> 在SQL Server Services 下查看SQL Server 服务是否处于运行状态。如果没有尝试启动服务并连接。
此外,在 SQL Server 网络配置下的 MS SQL Server 协议(protocol)下启用 TCP/IP。