Microsoft SQL,其中只有 2 个允许 Linux 客户端连接

Microsoft SQL,其中只有 2 个允许 Linux 客户端连接

这有点奇怪。我安装了两个 SQL Server 2016 实例。一个在我的笔记本电脑(Windows 10)上,另一个在 VPS(Windows Server 2012)上,在隔壁房间的开发服务器上。在同一台服务器上,还有另一个带有 Centos 7 和 odbc 的 VPS,它正在尝试连接到两个 SQL 实例。

连接到我的笔记本电脑的一个是成功的,sqlcmd -S .. -P -Q "query"另一方面,连接到 Windows 服务器返回错误

Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login timeout expired.
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : TCP Provider: Error code 0x102.
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..

当我尝试使用笔记本电脑的 SQL 客户端连接到 Windows 服务器时,一切顺利,没有超时,没有任何问题。

我已经禁用了所有防火墙(Windows 计算机 /vps 和笔记本电脑)。我只是想知道 Windows Server 2012 中的哪些东西可能会阻止 Linux 连接,导致它们超时,同时允许 Windows 连接...?

答案1

在我看来,您没有启用与 SQL 服务器的 TCP 连接: https://technet.microsoft.com/en-us/library/hh231672(v=sql.110).aspx 默认配置是不允许 TCP 连接 IIRC。

如果是 SQL Express,您可能还需要启用远程连接: http://blog.citrix24.com/configure-sql-express-to-accept-remote-connections/

相关内容