[UnixODBC]UnixODBC配置数据源-isql测试成功,但程序连接失败

初次接触UnixODBC,从安装到配置折腾了不少时间; 今天打算新加一个数据源,发生如下问题:

1. 配置数据源时,配置项理解错误;  DSN是ODBC的段名,ServerName是在tnsnames.ora中配置的段名

2. 在.etc/.odbc.ini中配置数据源后; 使用isql -v dsntest user password测试可以通过; 但用python flask写的服务连DB却报错;

最后发现需要在两个level的配置里面都配上odbc;   一个是system level,一个 user level:  可以通过obdcinst -j命令找到对应的文件目录


[dsntest]
Application Attributes = T
Attributes = W
BatchAutocommitMode = IfAllSuccessful
BindAsFLOAT = F
CloseCursor = F
DisableDPM = F
DisableMTS = T
Driver = Oracle 11g ODBC driver
DSN = dsntest
EXECSchemaOpt =
EXECSyntax = T
Failover = T
FailoverDelay = 10
FailoverRetryCount = 10
FetchBufferSize = 64000
ForceWCHAR = F
Lobs = T
Longs = T
MetadataIdDefault = F
QueryTimeout = T
ResultSets = T
ServerName = tnstest
SQLGetData extensions = F
Translation DLL =
Translation ption = 0
DisableRULEHint = T
UserID =

你可能感兴趣的:(unix,odbc,unix)