print pyodbc.dataSources()
print "Connecting via ODBC"
get a connection, if a connect cannot be made an exception will be raised here
conn = pyodbc.connect("DRIVER={NetezzaSQL Unicode};SERVER=localhost;PORT=5668;DATABASE=Database;UID=santiago;PWD=ha123;")
我收到此错误,我也安装了Netezza驱动程序,并安装了unixODBC-devel。我也是linux新手。我能帮忙吗?
{}
Connecting via ODBC
Traceback (most recent call last):
File "1.py", line 15, in <module>
conn = pyodbc.connect("DRIVER={NetezzaSQL Unicode};SERVER=localhost;PORT=5668;DATABASE=Database;UID=santiago;PWD=ha123>;")
pyodbc.Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified (0) (SQLDriverConnectW)')
答案 0 :(得分:0)
需要更改OBDC配置文件以访问正确的netezza驱动程序。你应该在/ etc。
中找到这个文件答案 1 :(得分:-1)
当您提供以下内容时会发生什么? conn = pyodbc.connect(“DRIVER = {NetezzaSQL}; SERVER = localhost; PORT = 5668; DATABASE =数据库; UID =圣地亚哥; PWD = ha123;”)