Sybase Linux vs Sybase Windows BCP - Can't Connect

1.9k Views Asked by At

I've been doing some Sybase stuff on Linux and have bcp in's and out's working great. Here's my working bcp out on linux:

bcp drd02.dbo.APPL_ENVIRONMENT out APPL_ENVIRONMENT.bcp -U sa -P SyAdmin  -n

When trying the same in Windows, I get the following error:

ct_connect(): network packet layer: internal net library error: Net-Lib protocol driver call to connect two endpoints failed

Here's a few pertinent details:

I can connect to my server via iSQL GUI. Its shown as Sybase157 0.0.0.0 5000 and my Drd02 database is online and available.

Contents of the c:\sybase\ini\sql.ini are (I added the drd02 lines):

[Sybase157_XP]
master=NLWNSCK,0.0.0.0,5001
query=NLWNSCK,0.0.0.0,5001
drd02=NLWNSCK,0.0.0.0,5001

[Sybase157]
master=NLWNSCK,0.0.0.0,5000
query=NLWNSCK,0.0.0.0,5000
drd02=NLWNSCK,0.0.0.0,5000

[Sybase157_JSAGENT]
master=NLWNSCK,0.0.0.0,4900
query=NLWNSCK,0.0.0.0,4900

The environment variables are:

%DSQUERY%=Sybase157
%SYBASE%=c:\Sybase

No matter what I try, it's just not connecting. I'd be happy for any help that could be provided.

1

There are 1 best solutions below

0
On

I figured it out. The fact that i could get into isql with the IP address made me think that maybe 0.0.0.0 is somehow not available to Bcp.

I modified c:\sybase\ini\sql.ini with the following:

from:

[Sybase157]
master=NLWNSCK,0.0.0.0,5000
query=NLWNSCK,0.0.0.0,5000
drd02=NLWNSCK,0.0.0.0,5000

to:

[Sybase157]
master=NLWNSCK,123.123.123.123,5000
query=NLWNSCK,0.0.0.0,5000
drd02=NLWNSCK,0.0.0.0,5000

after putting my public IP address of my vm in the sql.ini, bcp was able to speak to it correctly.

I should mention this was just a one-time fix to make it work, making this change will probably mess up external connections to the db. You'd need a loopback adapter or something to make this work right.