Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Christina-an/14337fb8be84e587d1f6752f038e5350 to your computer and use it in GitHub Desktop.
Save Christina-an/14337fb8be84e587d1f6752f038e5350 to your computer and use it in GitHub Desktop.
Connect to Db2 database on Cloud using Python
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@paragpallavsingh
Copy link

can you help me with this.
I am facing this error:
image

I have just created service credentials using IBM DB2 and trying to connect but getting the above error.

@Christina-an
Copy link
Author

Have you tried the basic checks? -> https://www.ibm.com/support/pages/error-sql30082n-reason-code-19-or-24
Especially 1 and 4, with 4 being very simple to do and its a problem I also faced when I was doing my IBM course's projects.

@paragpallavsingh
Copy link

Yes. but it's still giving the same error.
I am using Jupyter notebooks online on (https://labs.cognitiveclass.ai/tools/jupyterlab). and creating the credentials as guided.

Here are my service credentials:
image
"hostname": "55fbc997-9266-4331-afd3-888b05e734c0.bs2io90l08kqb1od8lcg.databases.appdomain.cloud",
"port": 31929
image
"password": "PxFOdoGFbeYNGecM",
"username": "knl99386"

But they are giving the same error.

@Christina-an
Copy link
Author

Tried the reinstalling?

!pip install --force-reinstall ibm_db==3.1.0 ibm_db_sa==0.3.7
import ibm_db

@CGCprojects
Copy link

You have to uninstall your DB2 service. Re-install the DB2, then re-create the credentials.
Dallas worked for me.
I was using London but had the same problem error 19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment