Python 3和IBM_DB安装问题

问题描述 投票:0回答:1

我目前正在使用Windows 10计算机和Python 3.6.3,并已下载并安装了此处列出的要求:https://www.ibm.com/support/knowledgecenter/en/SSSNY3_10.1.0/com.ibm.swg.im.dbclient.python.doc/doc/t0054367.html来自以下链接:

https://www.ibm.com/support/knowledgecenter/en/SSSNY3_10.1.0/com.ibm.swg.im.dbclient.python.doc/doc/r0054697.html

我已经安装了ODBC驱动程序(IBM DB2 ODBC Driver)并在Windows 10计算机上的ODBC数据源管理器界面中对其进行了配置。我还使用适当的设置为SQL Server连接做了这个。

我遇到的问题是我收到以下错误:

Traceback (most recent call last):
  File "C:\Users\<Username>\Python\Test IBM Connection.py", line 6, in <module>
    ibm_db.connect("<DSN>","<Username>","<Password>")
Exception: [IBM][CLI Driver] SQL1531N  The connection failed because the name
specified with the DSN connection string keyword could not be found in either 
the db2dsdriver.cfg configuration file or the db2cli.ini configuration file.  
Data source name specified in the connection string: "<DSN>".
 SQLCODE=-1531

我当然用谷歌搜索这个问题无济于事。我是IBM_DB的新手,它需要帮助配置DSN才能正常工作。

我也尝试过运行db2dsdcfgfill - 但是没有成功,请看这里:https://www.ibm.com/support/knowledgecenter/en/SSEPGG_9.5.0/com.ibm.swg.im.dbclient.config.doc/doc/r0054557.html

我不确定这些文件中需要哪些信息,以及它们需要的位置以及如何注册它们以便系统看到它们。

我已经能够连接和查询SQL Server,但无法连接到IBM iSeries AS400系统。

我已经研究了我遇到的问题的很多部分,但没有找到解决我问题的方法。

根据要求,我添加了以下信息:

连接字符串:

ibm.connect("<DSN>", "<Username>","<Password>")

ODBC版本是11.01.00.1527

我正在连接到IBM iSeries数据库 - 它在system i上运行并且运行的是7.2版

python python-3.x db2
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.