我在应用程序日志中收到以下错误
[Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: An existing connection was forcibly closed by the remote host."
我正在使用 Microsoft SQL Server 2014,对于数据源,我正在使用 ODBC Driver 17 for SQL Server。所有连接检查似乎工作正常,但数据库连接间歇性关闭。任何想法或建议表示赞赏。
最佳答案
我自己也遇到了这个问题,希望能说明一些问题。驱动程序版本:SQL Server 的 ODBC 驱动程序 17。 2017.174.02.01
查看SQL Server日志,发现类似这样的错误:
Log entry: Error: 17832, Severity: 20, State: 11.
The login packet used to open the connection is structurally invalid; the connection has been closed. Please contact the vendor of the client library. [CLIENT: x.x.x.x]
然后我在 MSDocs 站点上找到了这个与 17832
事件 ID 匹配的文档。
https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/mssqlserver-17832-database-engine-error?view=sql-server-ver15
它描述了 SQL Server 本身的 MaxTokenSize
设置对于这个特定的登录 token 来说可能太小了。您可以将 MaxTokenSize
设置为更大的值以进行测试,如果这样可以解决问题,您将需要找出实际的 token 大小并将其设置为只有那么大。
关于sql-server - [Microsoft][SQL Server 的 ODBC 驱动程序 17]TCP 提供程序 : An existing connection was forcibly closed by the remote host,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58971070/