I installed ibm_db in python with pip install ibm_db and created a db2dsdriver.cfg file with the following content:
<configuration>
<dsncollection>
<dsn alias="BANK0002" name="BANK0002" host="localhost" port="50000"/>
</dsncollection>
<databases>
<database name="BANK0002" host="BANK0002" port="50000"/>
</databases>
</configuration>
Running this command line I can connect with the database and allows me to run a select statement with no issues:
db2cli execsql -user DB2INST1 -passwd xxxxx -dsn bank0002
The problem is that I cannot connect from Python:
conn = ibm_db.connect("UID=DB2INST1;PWD=xxxxxx;DATABASE=bank0002;
HOSTNAME=localhost;PORT=50000;PROTOCOL=TCPIP;", "", "")
throws:
SQLCODE=-30082n: [IBM][CLI Driver] SQL30082N Security processing failed with reason "17" ("UNSUPPORTED FUNCTION"). SQLSTATE=08001
What is this problem and how to fix it?
python -V
Python 3.8.5
pip show ibm_db
Name: ibm-db
Version: 3.0.2
Summary: Python DBI driver for DB2 (LUW, zOS, i5) and IDS
Home-page: http://pypi.python.org/pypi/ibm_db/
Author: IBM Application Development Team
Author-email: [email protected]
License: Apache License 2.0
Location: c:\tools\miniconda3\envs\env38\lib\site-packages
UID=...instead ofUSER=..., andPWD=...instead ofPASSWD=.... . Also what is the conda version? (There were reports in the past of issues involving ibm_db with conda, but most are resolved). Please specify if you tried with Admin mode (for install , as well as run, and if there is any different symptom).SQLCODE=-1042on: [IBM][CLI Driver] SQL1042C An unexpected system error occurred. SQLSTATE=58004