ajesh_yarlagadda has asked for the wisdom of the Perl Monks concerning the following question:

We are facing connectivity issue while trying to access Sybase database from a Perl module. We are trying to access remote Sybase database from a Perl script on a linux server. We have installed Sybase OCS 16.0.0 and DBD-Sybase-1.15.20 on the Linux server Below is the code snippet we are using to connect to Sybase database
Code: $dbh_auto = DBI->connect('dbi:Sybase:server=XXXXXX;database=XXXXXX',$A +PP_SYB_USER,$APP_SYB_PASS); Error : DBI connect('server=XXXXXXX;database=XXXXX','xxxxx',...) failed: Serve +r message number=4002 severity=14 state=1 line=0 server=XXXXXX text=L +ogin failed. OpenClient message: LAYER = (4) ORIGIN = (1) SEVERITY = (4) NUMBER = ( +44) Server lon_gbe_sql_dev2, database Message String: ct_connect(): protocol specific layer: external error: + The attempt to connect to the server failed.
We were able to access the database using iSQL and SQL developer with same credentials.

Replies are listed 'Best First'.
Re: Sybase connectivity issue
by Corion (Patriarch) on Aug 07, 2017 at 07:54 UTC

    That error means Login failed, so your credentials in $APP_SYB_USER and/or $APP_SYB_PASS do not match what the server expects.

    How do you set these credentials? Does it work when you hardcode them?

    $APP_SYB_USER = 'scott'; $APP_SYB_PASS = 'tiger'; my $dbh = DBI->connect(...);

      ++ for using default Oracle credentials in response to a Sybase question :)