Я использую:
- < li>Python 3.12, 64-разрядная версия локально
- Windows 11 Home
# apparently I need to add the clipdriver dll before importing ibm_db
os.add_dll_directory('path_to_clidriver')
import ibm_db
cnx_string = 'DATABASE=database_name;HOSTNAME=hostname.com;PORT=9088;PROTOCOL=tcpip;UID=user;PWD=123;'
try:
conn = ibm_db.connect(cnx_string, "", "")
print("Connected successfully!")
except Exception as e:
print(f"Unable to connect: {e}")
exit()
ibm_db.close(conn)
И вот сообщение об ошибке, которое я получаю повторно:
Unable to connect: [IBM][CLI Driver] SQL30081N A communication error has been detected. Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS". Location where the error was detected: "119.82.149.212". Communication function detecting the error: "recv". Protocol specific error code(s): "*", "*", "0". SQLSTATE=08001 SQLCODE=-30081
PS G:\My Drive\Python\ibm-db>
Подробнее здесь: https://stackoverflow.com/questions/790 ... hon-ibm-db