我无法将我的 db2 应用程序连接到我的本地主机数据库。
应用程序使用的 db2 API 需要 TCPIP 并尝试连接到主机“localhost”和端口“50001”。
我的错误是 .
SQL30081N A communication error has been detected.
Communication protocol being used:
"TCP/IP". Communication API being used: "SOCKETS". Location where
the error was detected: "127.0.0.1". Communication function detecting
the error: "connect". Protocol speci fic error code(s): "111", "*"
, "*". SQLSTATE=08001
我必须手动设置以下所有内容,因为我的机器上没有它
我看了wireshark
看发生了什么,但我可以看到通信已重置..plus使用telnet the communication is not established and
netstat
doesn't listen that port.
Do I have to issue some extra command to start listening?
Below all my setup.
db2 "get database manager configuration" | grep SVC
TCP/IP Service name (SVCENAME) = db2c_db2inst1
SSL service name (SSL_SVCENAME) =
Then the services
cat /etc/services | grep db2c_
db2c_db2inst1 50001/tcp # DB2 connection service port
I also allow the firewall on that port.
iptables -I INPUT -p tcp --dport 50001 -j ACCEPT
/sbin/service iptables save
iptables -list
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:db2c_db2inst1