Python Pyodbc连接错误 密码

Python Pyodbc连接错误 密码,python,linux,pyodbc,netezza,unixodbc,Python,Linux,Pyodbc,Netezza,Unixodbc,这是我在linux Red Hat 64位中使用python 2.6输入的代码 import pyodbc print pyodbc.dataSources() print "Connecting via ODBC" conn = pyodbc.connect("DRIVER={NetezzaSQL};SERVER=localhost;PORT=5480;DATABASE=Database;UID=santiago;PWD=ha123;") 错误 这是我在运行pyodbc时收到的真实错误

这是我在linux Red Hat 64位中使用python 2.6输入的代码

import pyodbc

print pyodbc.dataSources()

print "Connecting via ODBC"

conn = pyodbc.connect("DRIVER={NetezzaSQL};SERVER=localhost;PORT=5480;DATABASE=Database;UID=santiago;PWD=ha123;")
错误 这是我在运行pyodbc时收到的真实错误。我不知道这种语言是什么,或者它的意思是什么

{'ODBC': '', 'NetezzaSQL': '/usr/local/nz_7.2.0.3/lib64/libnzodbc.so'}
Connecting via ODBC
Traceback (most recent call last):
  File "connect.py", line 41, in <module>
conn = pyodbc.connect("DRIVER{NetezzaSQL};SERVER=localhost;PORT=5480;DATABASE=Database;UID=santiago;PWD=ha123;")
pyodbc.Error: ('H00', '[H00] [unixODBC]Sre n/rpr trbtsaeepy\xc8 (33) (SQLDriverConnectW)')
obdc.ini 这是使用的odbc配置文件

[ODBC Drivers]
NetezzaSQL = Installed

[NetezzaSQL]
Driver           = /usr/local/nz_7.2.0.3/lib64/libnzodbc.so
Setup            = /usr/local/nz_7.2.0.3/lib64/libnzodbc.so
APILevel         = 1
ConnectFunctions = YYN
Description      = Netezza ODBC driver
DriverODBCVer    = 03.51
DebugLogging     = false
LogPath          = /tmp
UnicodeTranslationOption = utf8
CharacterTranslationOption = all
PreFetch         = 256
Socket           = 16384
;
;  odbc.ini
;
[ODBC Data Sources]
NZSQL = NetezzaSQL


[NetezzaSQL]
;Path of a driver used for database connection
Driver                = /usr/local/nz_7.2.0.3/lib64/libnzodbc.so

;A decription used to identify the database connection properties.
Description           = NetezzaSQL ODBC

;The name of a machine or IP address where the database is located.
Servername            = 127.0.0.1

;The port number to connect.
Port                  = 5480

;The name of a database.
Database              = dev

;The name of a valid user.
Username              = guest

;The password for  the user.
Password              = password

;Only Select SQL statements will be allowed if this field is checked.
ReadOnly              = false

;When this option is enabled and the application bindtype is same as   backend
;datatype the query performance will be faster.Query performance gain will be achieved 
;only for single select statements (not for batch queries).It also works in case when
;application bind type is different than backend datatype but there are some restrictions on it.
FastSelect            = false

;When set to true, system tables will be included in the available table list.
ShowSystemTables      = false

;When set to true, use old (2.5) functionality for returning schemas in  SQLTables.
LegacySQLTables       = false

;Specifies login timeout in seconds.
LoginTimeout          = 0

;Specifies query timeout in seconds.
QueryTimeout          = 0

;Specifies date format as follows -
; 1: YMD
; 2: MDY
; 3: DMY
DateFormat            = 1

;When selected, driver treats SQL_C_NUMERIC buffers as SQL_C_CHAR   buffers.
NumericAsChar         = false

;Return SQL_BIT as "1"/"0" when char.
SQLBitOneZero         = false

;When enabled, replaces all occurences of CRLF, CR and LF with a single space.
StripCRLF             = false

;Specifies level of security on the system
securityLevel         = preferredUnSecured

;Name of the Root CA certificate.
caCertFile            =

;Specifies maximum errors allowed. 0 value means no limit on  loadMaxErrors value.
;loadMaxErrors         = 1

;If value is true, it rounds the data of numeric columns whose precision  exceeds the precision defined.
;loadRoundFraction     = 0


[ODBC]
IANAAppCodePage=4
InstallDir=/opt/odbc32v51
Trace=0
TraceDll=/opt/odbc32v51/lib/odbctrac.so
TraceFile=odbctrace.out
UseCursorLib=0

如果需要确定解决方案,请告诉我。

我无法告诉您错误的含义,因为我也无法识别语言。但是,Netezza ODBC端口是5480,而您在连接方法中指定5668。另外,您真正想要连接的数据库是否实际命名为“数据库”

我更改了属性,因为在web上放置私人信息不好,但我在中获得了正确的数据库,原始代码中包含了5480。我在windows中使用带有原始属性的python运行了相同的代码,它工作了,但在我的linux机器上它不工作。您可能希望始终对其进行更改,否则它看起来像是配置/参数错误(请参阅您稍后在示例ODBC.ini中指定的端口)。谢谢,我编辑了这个问题。您认为这可能是python解释器的问题吗?