0

我正面临 dotNET 核心应用程序的这个问题,它使用 odbc.ini 中定义的 DSN 与 SQL 服务器连接和断开连接。目前我正在使用最新的 MS SQL ODBC 驱动程序,即 msodbcsql17-17.4.2.1-1 和 UnixODBC 驱动程序 unixODBC 2.3.7。

我也尝试将 MSSQL ODBC 驱动程序降级到 11 和 13,但都没有成功。

我当前来自 odbc.ini 的 DSN 设置如下:

[ICMDB]
Driver = /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.4.so.2.1
Server = 10.32.7.145
Port = 1433
User = user
Password = password
Database = inst3_sideA
Language = us_english

和日志文件包含以下错误:

2020-01-05 05:07:50.541 [T:9 P:17003] [FATAL] dbconnectivity.dbconnectivity ODBC Connected with Failure with connection string DSN=ICMDB;UID=qauser;Pwd=Password1;
System.Data.Odbc.OdbcException (0x80131937): ERROR [08001] [Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: [error:140A90F1:lib(20):func(169):reason(241)]
ERROR [08001] [Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection
at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle)
at System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection outerConnection, OdbcConnectionString connectionOptions)
at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.Odbc.OdbcConnection.Open()

提前致谢!

4

1 回答 1

0

幸运的是,我在同一天和相同的 IP 上观察到了同样的问题。您当前安装的 mysql odbc 驱动程序是 8.0.19,它不具有向后兼容性。将您的 mysql odbc 驱动程序降级到 8.0.17,然后查看它是否没有错误。:)

于 2020-01-22T20:59:04.960 回答