• 2 replies
  • Latest Post - ‏2010-05-27T22:17:42Z by WeiliYeh
17917 Posts

Pinned topic unable to connect remotely

‏2010-04-18T12:10:19Z |
I am new to db2, installed it a few days ago. I am able to work with it locally, using the unixODBC. However, I am unable to connect to db2 from a remote machine.
I am not sure whether the problem is on the server or the client side, so I'll give info on both:

I am running 2 virtual machines with centos linux on the same windows host, which can successfully ping each other.

when running [I]db2start[/I], I get the following message:
SQL5043N Support for one or more communications protocols failed to start successfully. However, core database manager functionality started successfully.

However, in the db2diag.log file (diag level 4) I see
MESSAGE : DIA3000I "TCPIP" protocol support was successfully started.

although, I see some "Error" and "Severe" entries there


db2inst1@bagvapp sqllib$ db2set -all
[g] DB2SYSTEM=bagvapp
[g] DB2INSTDEF=db2inst1
[g] DB2ADMINSERVER=dasusr1

db2inst1@bagvapp sqllib$ db2 get dbm cfg |grep -i svce
TCP/IP Service name (SVCENAME) = 50000
SSL service name (SSL_SVCENAME) =

root@bagvapp ~# grep -i db2 /etc/services
ibm-db2 523/tcp # IBM-DB2
ibm-db2 523/udp # IBM-DB2
questdb2-lnchr 5677/tcp # Quest Central DB2 Launchr
questdb2-lnchr 5677/udp # Quest Central DB2 Launchr
DB2_db2inst1 50000/tcp # This is for SVCENAME

I am using the free edition express-C v9.7.0.1

On the client side, I use unixODBC and libodbc++ which works ok locally.
When using the following connection string in C++ code:
const string connstring = "DSN=Navajo;Hostname=;Port=50000;Protocol=TCPIP;Uid=db2inst1;Pwd=zzz;";

I get the error:
unixODBCIBMCLI Driver CLI0199E Invalid connection string attribute. SQLSTATE=08001

the Data Source is defined in the /etc/odbc.ini as follows:

Description = Navajo Systems DB
Driver = DB2
Database = NAVAJO
Hostname =
Port = 50000
Protocol = TCPIP
Uid = db2inst1
Pwd = zzz

Note that db2 is also installed on the client machine as they are a replica of one another, but it is stopped.

Is there a tool with can help me check whether the database is listening properly (perhaps from Windows)?

Sorry for the long post, thanks in advance!

  • venkateshbabu.ks
    18 Posts

    Re: unable to connect remotely

    with express-C we can not connect to remote DB. we need a licensed version.
  • WeiliYeh
    3 Posts

    Re: unable to connect remotely

    with express-C we can not connect to remote DB. we need a licensed version.
    try the PCT connection test tool. step by step instruction available here