Skip to Content.
Sympa Menu

freetds - Re: [freetds] DBD::Sybase connect problems

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: patrick.dunnigan AT centivia.com
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] DBD::Sybase connect problems
  • Date: Wed, 16 Mar 2005 16:51:50 -0500

That's not a connectivity problem. Possibly a permissions problem. The
DynaLoader is trying to dynamically load the DBD:Sybase shared libraries and
can't seem to find them. Make sure the use running the perl script can see
the files under /usr/lib/perl5/site_perl/5.8.0/i686-linux/DBD (or whatever
the library path is).

Also could be if you have two Perls on the box, and you installed DBD Sybase
on one but are running the script against the other.

Doubtful, but it may be something to do with the multi threaded perl that
comes with ES 3. You may want to download the latest stable perl and build
DBI and DBD against that.

Lastely, as a suggestion: if you specify the whole connection string in the
perl script, you can forget about having to modify freetds.conf everytime you
want to access a different db. Put the port and tds version in the global
settings of freetds.conf and use the following conn string (if you want):

my $dbh =
DBI->connect("dbi:Sybase:server=<servername>;database=<dbname>","<userid>",
"<password>",{RaiseError => 1}) or die "Can't connect: $DBI::errstr";


>I downloaded and compiled FreeTDS to access a SQL Server 2000 database
>from Red Hat Enterprise Linux ES release 3.
>
>I compiled with the following options:
>-bash-2.05b$ tsql -C
>locale is "en_US"
>locale charset is "ISO-8859-1"
>Compile-time settings (established with the "configure" script):
> Version: freetds v0.62.4
> MS db-lib source compatibility: no
> Sybase binary compatibility: unknown
> Thread safety: no
> iconv library: yes
> TDS version: 8.0
> iODBC: no
> unixodbc: no
>I can conntect to the SQL Server with the tsql utility and execute queries.
>
>-bash-2.05b$ tsql -U testuser -S REMOTEDB
>locale is "en_US"
>locale charset is "ISO-8859-1"
>Password:
>Msg 5703, Level 0, State 1, Server REMOTEDB, Line 0
>Changed language setting to us_english.
>
>However whenever I connect to the database from Perl using the
>DBD::Sybase (1.05) I get the following error.
>
>-bash-2.05b$ ./db.pl
>cs_config(CS_LOC_PROP) failed at
>/usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 249.
>
>My db.pl scripts is as follows.
>
>#!/usr/bin/env perl
>use strict;
>use diagnostics;
>use DBI;
>
>BEGIN {
> $ENV{SYBASE} = '/utils/freetds';
> $ENV{DSQUERY} = 'REMOTEDB';
>}
>
>my $user = 'testuser';
>my $passwd = 'testpassword';
>
>my $dbh =
> eval { DBI->connect( 'dbi:Sybase:', $user, $passwd ); }
> or die($!);
>
>$dbh->disconnect();
>
>The script never makes it pass the connect statement.
>
>My freetds conf look like this.
>
># A typical Microsoft SQL Server 2000 configuration
>[REMOTEDB]
>; host = 192.168.1.15
> host = remotedb.mydomain.com
> port = 1433
> tds version = 7.0
>
>Can someone point me in the right direction?
>
>--
>Sincerely,
>Khurt Williams, MSE, CISSP
>
>
>
>
>--
>Sincerely,
>Khurt Williams, MSE, CISSP
>_______________________________________________
>FreeTDS mailing list
>FreeTDS AT lists.ibiblio.org
>http://lists.ibiblio.org/mailman/listinfo/freetds
>
>




Archive powered by MHonArc 2.6.24.

Top of Page