SQLCODE=-30081 Cannot connect to IBM DB2 database with pythonHow do I connect to a MySQL Database in Python?.net application cannot connect to DB2 DataBaseIBM DB2 Connection using VS2012 framework 4DB2 Connection StringHow to connect to Netezza/PureData for Analytics using PythonA communication error has been detected PHP DB2 ConnectionDB2 : Python ibm_db2 connecting, which port to use?DB2 with .NET viual studio 2017 errors out ERROR [08001] [IBM] SQL30081NCreating a DB2 connection with ibm_db gives Reason code: “3”. SQLCODE=-1390DB2 ODBC Connection thru Excel VBA
Does "boire un jus" tend to mean "coffee" or "juice of fruit"?
What overwrites /etc/resolv.conf roughly every hour?
How to track mail undetectably?
Find the closest three-digit hex colour
Why will we fail creating a self sustaining off world colony?
Why would Dementors torture a Death Eater if they are loyal to Voldemort?
Dynamic Sql Query - how to add an int to the code?
Is it advisable to inform the CEO about his brother accessing his office?
Copy group of files (Filename*) to backup (Filename*.bak)
Does friction always oppose motion?
How do I keep a running total of data in a column in Excel?
How far can gerrymandering go?
Why is exile often an intermediate step?
Installed software from source, how to say yum not to install it from package?
What was the point of separating stdout and stderr?
Is my guitar action too high or is the bridge too high?
Avoiding repetition when using the "snprintf idiom" to write text
How does the 'five minute adventuring day' affect class balance?
Why isn't UDP with reliability (implemented at Application layer) a substitute of TCP?
Why did the Apple //e make a hideous noise if you inserted the disk upside down?
How did they film the Invisible Man being invisible in 1933?
Having to constantly redo everything because I don't know how to do it
Where to connect the fuse and why?
Active wildlife outside the window- Good or Bad for Cat psychology?
SQLCODE=-30081 Cannot connect to IBM DB2 database with python
How do I connect to a MySQL Database in Python?.net application cannot connect to DB2 DataBaseIBM DB2 Connection using VS2012 framework 4DB2 Connection StringHow to connect to Netezza/PureData for Analytics using PythonA communication error has been detected PHP DB2 ConnectionDB2 : Python ibm_db2 connecting, which port to use?DB2 with .NET viual studio 2017 errors out ERROR [08001] [IBM] SQL30081NCreating a DB2 connection with ibm_db gives Reason code: “3”. SQLCODE=-1390DB2 ODBC Connection thru Excel VBA
I am able to connect to DB2 just fine with my TOAD application however I need to be able to connect within python to build some automated reports.
I have installed the ibm_db
library and I am trying to follow the instructions but I keep getting error SQLCODE=-30081
.
import ibm_db
conn_str = 'database=XXXX;hostname=XXXX.host.com;port=11111;protocol=tcpip;uid=user;pwd=password'
conn = ibm_db_conn = ibm_db.connect(conn_str,'','')
Traceback:
Traceback (most recent call last):
File "C:/Users/username/PycharmProjects/Report/MAIN/MAIN.py", line 4, in <module>
conn = ibm_db_conn = ibm_db.connect(conn_str,'','')
SQLCODE=-30081
Looking up -30081
is not very helpful as it can be caused by a list of things.
I did read somewhere that maybe ibm_db
is only supported on Python 3.4 and I am using Python 3.6 however I cannot install Python 3.4 on my work PC right now as its admin locked.
Update:
Tested connection using the command line with the 2 different connections options available to ibm_db.
Both connections types:
import ibm_db
conn_str = 'database=XXXX;hostname=111.111.111.111;port=11111;protocol=tcpip;uid=username;pwd=password'
try:
conn = ibm_db.connect(conn_str, '', '')
except:
print("no connection:", ibm_db.conn_errormsg())
else:
print("The 1st connection was successful")
try:
conn = ibm_db.connect('XXXX', 'username', 'password')
except:
print("no connection:", ibm_db.conn_errormsg())
else:
print("The 2nd connection was successful")
Error:
C:UsersusernameDesktopPython 3.6.2>python test.py
no connection: [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: "111.111.111.111". Communica SQLCODE=-30081etecting the error: "recv". Protocol specific error code(s): "10054", "*", "0". SQLSTATE=08001
no connection: [IBM][CLI Driver] SQL30082N Security processing failed with reason "19" ("USERID DISABLED or RESTRICTED" SQLCODE=-30082001
Any guidance would be appreciated.
python db2 database-connection
|
show 6 more comments
I am able to connect to DB2 just fine with my TOAD application however I need to be able to connect within python to build some automated reports.
I have installed the ibm_db
library and I am trying to follow the instructions but I keep getting error SQLCODE=-30081
.
import ibm_db
conn_str = 'database=XXXX;hostname=XXXX.host.com;port=11111;protocol=tcpip;uid=user;pwd=password'
conn = ibm_db_conn = ibm_db.connect(conn_str,'','')
Traceback:
Traceback (most recent call last):
File "C:/Users/username/PycharmProjects/Report/MAIN/MAIN.py", line 4, in <module>
conn = ibm_db_conn = ibm_db.connect(conn_str,'','')
SQLCODE=-30081
Looking up -30081
is not very helpful as it can be caused by a list of things.
I did read somewhere that maybe ibm_db
is only supported on Python 3.4 and I am using Python 3.6 however I cannot install Python 3.4 on my work PC right now as its admin locked.
Update:
Tested connection using the command line with the 2 different connections options available to ibm_db.
Both connections types:
import ibm_db
conn_str = 'database=XXXX;hostname=111.111.111.111;port=11111;protocol=tcpip;uid=username;pwd=password'
try:
conn = ibm_db.connect(conn_str, '', '')
except:
print("no connection:", ibm_db.conn_errormsg())
else:
print("The 1st connection was successful")
try:
conn = ibm_db.connect('XXXX', 'username', 'password')
except:
print("no connection:", ibm_db.conn_errormsg())
else:
print("The 2nd connection was successful")
Error:
C:UsersusernameDesktopPython 3.6.2>python test.py
no connection: [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: "111.111.111.111". Communica SQLCODE=-30081etecting the error: "recv". Protocol specific error code(s): "10054", "*", "0". SQLSTATE=08001
no connection: [IBM][CLI Driver] SQL30082N Security processing failed with reason "19" ("USERID DISABLED or RESTRICTED" SQLCODE=-30082001
Any guidance would be appreciated.
python db2 database-connection
Is this the correct port? Any details on the error? Can you telnet to that host and port?
– data_henrik
Mar 25 at 15:45
@data_henrik The port is invalid for the sake of the post but the port used in the code is correct as I can connect just fine using my other query tools. There are no detailed errors. That traceback is all I get. I am not able to telnet as it is not a function I am allowed to do at work however I can run queries just fine using my other reporting tools like TOAD.
– Mike - SMT
Mar 25 at 15:55
Any firewall or Db2 security setting (e.g., trusted context) that filters based on application name or similar?
– data_henrik
Mar 25 at 16:05
@data_henrik not that I am aware of. I have connected to other databases using python such as Oracle with this same PC so I do not believe they are filtering per application. Also I have used power query in excel to connect to databases as well and other applications.
– Mike - SMT
Mar 25 at 16:11
My python 3.7 works fine with ibm_db on Windows7. Edit your question to add the version of ibm_db that you are using. In your exception handler, print the ibm_db.conn_errormsg() to see the full error message.
– mao
Mar 25 at 16:23
|
show 6 more comments
I am able to connect to DB2 just fine with my TOAD application however I need to be able to connect within python to build some automated reports.
I have installed the ibm_db
library and I am trying to follow the instructions but I keep getting error SQLCODE=-30081
.
import ibm_db
conn_str = 'database=XXXX;hostname=XXXX.host.com;port=11111;protocol=tcpip;uid=user;pwd=password'
conn = ibm_db_conn = ibm_db.connect(conn_str,'','')
Traceback:
Traceback (most recent call last):
File "C:/Users/username/PycharmProjects/Report/MAIN/MAIN.py", line 4, in <module>
conn = ibm_db_conn = ibm_db.connect(conn_str,'','')
SQLCODE=-30081
Looking up -30081
is not very helpful as it can be caused by a list of things.
I did read somewhere that maybe ibm_db
is only supported on Python 3.4 and I am using Python 3.6 however I cannot install Python 3.4 on my work PC right now as its admin locked.
Update:
Tested connection using the command line with the 2 different connections options available to ibm_db.
Both connections types:
import ibm_db
conn_str = 'database=XXXX;hostname=111.111.111.111;port=11111;protocol=tcpip;uid=username;pwd=password'
try:
conn = ibm_db.connect(conn_str, '', '')
except:
print("no connection:", ibm_db.conn_errormsg())
else:
print("The 1st connection was successful")
try:
conn = ibm_db.connect('XXXX', 'username', 'password')
except:
print("no connection:", ibm_db.conn_errormsg())
else:
print("The 2nd connection was successful")
Error:
C:UsersusernameDesktopPython 3.6.2>python test.py
no connection: [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: "111.111.111.111". Communica SQLCODE=-30081etecting the error: "recv". Protocol specific error code(s): "10054", "*", "0". SQLSTATE=08001
no connection: [IBM][CLI Driver] SQL30082N Security processing failed with reason "19" ("USERID DISABLED or RESTRICTED" SQLCODE=-30082001
Any guidance would be appreciated.
python db2 database-connection
I am able to connect to DB2 just fine with my TOAD application however I need to be able to connect within python to build some automated reports.
I have installed the ibm_db
library and I am trying to follow the instructions but I keep getting error SQLCODE=-30081
.
import ibm_db
conn_str = 'database=XXXX;hostname=XXXX.host.com;port=11111;protocol=tcpip;uid=user;pwd=password'
conn = ibm_db_conn = ibm_db.connect(conn_str,'','')
Traceback:
Traceback (most recent call last):
File "C:/Users/username/PycharmProjects/Report/MAIN/MAIN.py", line 4, in <module>
conn = ibm_db_conn = ibm_db.connect(conn_str,'','')
SQLCODE=-30081
Looking up -30081
is not very helpful as it can be caused by a list of things.
I did read somewhere that maybe ibm_db
is only supported on Python 3.4 and I am using Python 3.6 however I cannot install Python 3.4 on my work PC right now as its admin locked.
Update:
Tested connection using the command line with the 2 different connections options available to ibm_db.
Both connections types:
import ibm_db
conn_str = 'database=XXXX;hostname=111.111.111.111;port=11111;protocol=tcpip;uid=username;pwd=password'
try:
conn = ibm_db.connect(conn_str, '', '')
except:
print("no connection:", ibm_db.conn_errormsg())
else:
print("The 1st connection was successful")
try:
conn = ibm_db.connect('XXXX', 'username', 'password')
except:
print("no connection:", ibm_db.conn_errormsg())
else:
print("The 2nd connection was successful")
Error:
C:UsersusernameDesktopPython 3.6.2>python test.py
no connection: [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: "111.111.111.111". Communica SQLCODE=-30081etecting the error: "recv". Protocol specific error code(s): "10054", "*", "0". SQLSTATE=08001
no connection: [IBM][CLI Driver] SQL30082N Security processing failed with reason "19" ("USERID DISABLED or RESTRICTED" SQLCODE=-30082001
Any guidance would be appreciated.
python db2 database-connection
python db2 database-connection
edited Mar 25 at 18:26
Mike - SMT
asked Mar 25 at 15:42
Mike - SMTMike - SMT
10.1k2 gold badges16 silver badges37 bronze badges
10.1k2 gold badges16 silver badges37 bronze badges
Is this the correct port? Any details on the error? Can you telnet to that host and port?
– data_henrik
Mar 25 at 15:45
@data_henrik The port is invalid for the sake of the post but the port used in the code is correct as I can connect just fine using my other query tools. There are no detailed errors. That traceback is all I get. I am not able to telnet as it is not a function I am allowed to do at work however I can run queries just fine using my other reporting tools like TOAD.
– Mike - SMT
Mar 25 at 15:55
Any firewall or Db2 security setting (e.g., trusted context) that filters based on application name or similar?
– data_henrik
Mar 25 at 16:05
@data_henrik not that I am aware of. I have connected to other databases using python such as Oracle with this same PC so I do not believe they are filtering per application. Also I have used power query in excel to connect to databases as well and other applications.
– Mike - SMT
Mar 25 at 16:11
My python 3.7 works fine with ibm_db on Windows7. Edit your question to add the version of ibm_db that you are using. In your exception handler, print the ibm_db.conn_errormsg() to see the full error message.
– mao
Mar 25 at 16:23
|
show 6 more comments
Is this the correct port? Any details on the error? Can you telnet to that host and port?
– data_henrik
Mar 25 at 15:45
@data_henrik The port is invalid for the sake of the post but the port used in the code is correct as I can connect just fine using my other query tools. There are no detailed errors. That traceback is all I get. I am not able to telnet as it is not a function I am allowed to do at work however I can run queries just fine using my other reporting tools like TOAD.
– Mike - SMT
Mar 25 at 15:55
Any firewall or Db2 security setting (e.g., trusted context) that filters based on application name or similar?
– data_henrik
Mar 25 at 16:05
@data_henrik not that I am aware of. I have connected to other databases using python such as Oracle with this same PC so I do not believe they are filtering per application. Also I have used power query in excel to connect to databases as well and other applications.
– Mike - SMT
Mar 25 at 16:11
My python 3.7 works fine with ibm_db on Windows7. Edit your question to add the version of ibm_db that you are using. In your exception handler, print the ibm_db.conn_errormsg() to see the full error message.
– mao
Mar 25 at 16:23
Is this the correct port? Any details on the error? Can you telnet to that host and port?
– data_henrik
Mar 25 at 15:45
Is this the correct port? Any details on the error? Can you telnet to that host and port?
– data_henrik
Mar 25 at 15:45
@data_henrik The port is invalid for the sake of the post but the port used in the code is correct as I can connect just fine using my other query tools. There are no detailed errors. That traceback is all I get. I am not able to telnet as it is not a function I am allowed to do at work however I can run queries just fine using my other reporting tools like TOAD.
– Mike - SMT
Mar 25 at 15:55
@data_henrik The port is invalid for the sake of the post but the port used in the code is correct as I can connect just fine using my other query tools. There are no detailed errors. That traceback is all I get. I am not able to telnet as it is not a function I am allowed to do at work however I can run queries just fine using my other reporting tools like TOAD.
– Mike - SMT
Mar 25 at 15:55
Any firewall or Db2 security setting (e.g., trusted context) that filters based on application name or similar?
– data_henrik
Mar 25 at 16:05
Any firewall or Db2 security setting (e.g., trusted context) that filters based on application name or similar?
– data_henrik
Mar 25 at 16:05
@data_henrik not that I am aware of. I have connected to other databases using python such as Oracle with this same PC so I do not believe they are filtering per application. Also I have used power query in excel to connect to databases as well and other applications.
– Mike - SMT
Mar 25 at 16:11
@data_henrik not that I am aware of. I have connected to other databases using python such as Oracle with this same PC so I do not believe they are filtering per application. Also I have used power query in excel to connect to databases as well and other applications.
– Mike - SMT
Mar 25 at 16:11
My python 3.7 works fine with ibm_db on Windows7. Edit your question to add the version of ibm_db that you are using. In your exception handler, print the ibm_db.conn_errormsg() to see the full error message.
– mao
Mar 25 at 16:23
My python 3.7 works fine with ibm_db on Windows7. Edit your question to add the version of ibm_db that you are using. In your exception handler, print the ibm_db.conn_errormsg() to see the full error message.
– mao
Mar 25 at 16:23
|
show 6 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55341497%2fsqlcode-30081-cannot-connect-to-ibm-db2-database-with-python%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55341497%2fsqlcode-30081-cannot-connect-to-ibm-db2-database-with-python%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Is this the correct port? Any details on the error? Can you telnet to that host and port?
– data_henrik
Mar 25 at 15:45
@data_henrik The port is invalid for the sake of the post but the port used in the code is correct as I can connect just fine using my other query tools. There are no detailed errors. That traceback is all I get. I am not able to telnet as it is not a function I am allowed to do at work however I can run queries just fine using my other reporting tools like TOAD.
– Mike - SMT
Mar 25 at 15:55
Any firewall or Db2 security setting (e.g., trusted context) that filters based on application name or similar?
– data_henrik
Mar 25 at 16:05
@data_henrik not that I am aware of. I have connected to other databases using python such as Oracle with this same PC so I do not believe they are filtering per application. Also I have used power query in excel to connect to databases as well and other applications.
– Mike - SMT
Mar 25 at 16:11
My python 3.7 works fine with ibm_db on Windows7. Edit your question to add the version of ibm_db that you are using. In your exception handler, print the ibm_db.conn_errormsg() to see the full error message.
– mao
Mar 25 at 16:23