php - 远程 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 上打开与主机的连接:连接失败
解决方案
这解决了我的问题!
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.
推荐阅读
- asp.net - 由于实体类型'IdentityUserRole 上的'属性'xx',无法在数据库中播种表
' 有一个临时值 - laravel - Laravel 的 morphOne/morphTo 返回 null
- javascript - 在JS中的对象内过滤对象数组
- python - 如何在散景中做gridspec
- amp-html - `amp-list` 文档:src 属性中的 `<%host%>` URL 前缀是什么意思?
- django - 如何在 Django 中创建 pymongo 客户端(使用 uwsgi)
- angular - 构建角度应用程序时如何修复“架构验证错误”
- ruby-on-rails - Rails,ActiveRecord:列名匹配的 has_one
- javascript - 无法让小部件与 TPL 文件一起使用
- contentful - 内容丰富的媒体文件名/扩展名验证