首页 > 解决方案 > 远程 SQL Server 配置:哪些端口?

问题描述

我有一个在公共 IP 中运行 Windows Server 2012 的 VPS。我已经在上面安装了 SQL Server 并更改了防火墙,允许端口 1433 上的所有传入/传出 TCP 连接。

但是,当我尝试从 PHP 应用程序远程连接此服务器时,出现以下错误:

SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist

我应该允许连接工作的任何其他端口/协议吗?

当我尝试在端口 1433 上远程登录服务器时:

连接到 xxx.xxx.xxx.xxx...无法在端口 1433 上打开与主机的连接:连接失败

标签: phpsql-server

解决方案


这解决了我的问题!

Enable remote connections for SQL Server:
a) In SQL Server Configuration Manager, expand SQL Server Network Configuration, and then click Protocols for <instancename>.
b) In the details pane, right-click one of the available protocols, and then click Properties.
c) To enable the TCP/IP protocol (or named pipes) for remote connections, set the Enabled box to Yes.

推荐阅读