sql-server - 安装 Microsoft SQL Express 2012 后 FreeTDS 无限期挂起

标签 sql-server t-sql freetds

当我尝试连接到服务器时,FreeTDS 无限期挂起:

C:\FreeTDS\bin>tsql -H localhost -p 1433
locale is "English_United States.1252"
locale charset is "CP1252"
using default charset "CP1252"

(nothing else is displayed, can only exit with ^C)

当我运行 tsql -S <servername> 时,会发生相同的行为.

我最近卸载了 Microsoft SQL Server Management Studio,然后安装了 Express 版本。连接 tsql -H localhost -p 1433在卸载/安装之前有效。

正在运行tsql -C产量:

Compile-time settings (established with the "configure" script)
                        Version: freetds v0.91.98
         freetds.conf directory: /mingw/etc
 MS db-lib source compatibility: no
    Sybase binary compatibility: no
                  Thread safety: yes
                  iconv library: yes
                    TDS version: 7.0
                          iODBC: no
                       unixodbc: yes
          SSPI "trusted" logins: yes
                       Kerberos: yes (Heimdal 1.5.3)
                 SSL encryption: yes (OpenSSL 1.0.1e)

更多信息:

我正在运行以下与 SQL 相关的服务:

  • SQL 全文过滤器守护进程启动程序 (SQLEXPRESS)
  • SQL Server (SQLEXPRESS)
  • SQL Server 浏览器
  • SQL Server 报告服务 (SQLEXPRESS)
  • SQL Server VSS 编写器

我已尝试重新安装 FreeTDS。

我已在 Sql Server 配置管理器中为 SQLEXPRESS 启用 TCP/IP。

最佳答案

tsql 命令挂起,因为服务器未在默认端口上运行。我通过运行 C:\>netstat -na | 发现了这一点找到“1433”,它在端口 1433 上没有显示任何“LISTENING”。

这就是我解决问题的方法:

  1. 打开“Sql Server 配置管理器”
  2. 转到“SQL Server 网络配置 >SERVER 协议(protocol)”
  3. 右键点击“TCP/IP”,选择“属性”,转到“IP 地址”选项卡
  4. 在“IPAll”下将“TCP Port”设置为所需的端口号
  5. 单击“确定”,然后重新启动 SQL Server 服务。

TCP Port was previously blank, setting it to a valid port solved the problem.

关于sql-server - 安装 Microsoft SQL Express 2012 后 FreeTDS 无限期挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29310336/

相关文章:

ruby-on-rails - 为什么存在.so文件却出现 "no such file or directory"错误?

sql-server - RODBC odbcDriverConnect() 连接错误

sql-server - 将用户定义的表传递给存储过程

sql-server - SQL Server TSQL : Put Subsequent (date) rows into bins

sql-server - SQL Server 中增量批量删除和插入操作非常慢

ruby-on-rails - 如何将 SQL Server TableView 用作 Rails 模型(只读)?

sql - 基于 x+y 总计查询 x 项目的百分比

sql - 如何在同一表的一列中查找重复值而在另一列中查找不同值?

sql - WHERE 子句中的 IF/Else/CASE 语句

sql-server - 错误 20009(严重性 9):Unable to connect: Adaptive Server is unavailable or does not exist OS error 111, "Connection refused"