简体   繁体   中英

IBM DB2 Connections

Why can I connect to my sql db2 while using jupyter notebooks in ibm cloud but when I try to run the same connection string in ms vs code I get an error?

'''%sql ibm_db_sa://un:pw@host:port/db?security=SSL'''

(ibm_db_dbi.Error) ibm_db_dbi::Error: [IBM][CLI Driver] SQL5005C The operation failed because the database manager failed to access either the database manager configuration file or the database configuration file.\r SQLCODE=-5005 (Background on this error at: http://sqlalche.me/e/dbapi) Connection info needed in SQLAlchemy format, example: postgresql://username:password@hostname/dbname or an existing connection: dict_keys([])

Could you specify what is ms? Also please try to reach the dba admin to verify the user account has the correct privileges to access to the database. If you are trying to connect in remote mode from a Linux environment you will need a SSL certificate to ensure the correct connection. And check if the instance is UP and if not try to run db2start.

In my case I got error

SQL0332N Character conversion from the source code page "874" to the target code page "1252" is not supported. SQLCODE=-332

I found the codepage of table is 874 and my OS is not set non-Unicode so I go to the Region setting and I solved this by changing at 'Language for non-Unicoded programs' from English(United States) to Thai(Thailand)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM