Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

DBD::Sybase on Linux -- trouble?

by tale051258 (Initiate)
on Aug 01, 2012 at 19:23 UTC ( #984878=perlquestion: print w/replies, xml ) Need Help??
tale051258 has asked for the wisdom of the Perl Monks concerning the following question:

Oh wise monks, lend me some of your wisdom

I need to install DBD::Sybase on Red Hat Linux 5.4 (64-bit) but have been unable to locate a good set of instructions on how to do so. It seems -- from what I have read so far -- that it is not as straight forward as cpan install DBD::Sybase, so to speak.

Please lead me to the pearly gates -- no pun intended -- of where I can find simple instructions.

Replies are listed 'Best First'.
Re: DBD::Sybase on Linux -- trouble?
by blue_cowdawg (Monsignor) on Aug 01, 2012 at 19:32 UTC

    Check out FreeTDS. I used to use that when I had to connect to Sybase and MSSQL database servers at a former job.

    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

      Alas, this is what I indeed am trying. But the instructions below are dated -- for example, step 5. is not needed in the newer release of the .pm and step 6. seems to me to be incorrect. The instructions I am referring to can be found at and are repeated here for clarity.

      You can't use CPAN to install the DBD::Sybase Perl drivers on Linux. T +here are a couple things that need to be tweaked by hand. 1. Download FreeTDS from This a free alternat +ive to Sybase's ct-lib library packages (which I couldn't find anywhe +re on their web or ftp sites, and which I wasn't willing to install t +he whole DB just to get). 2. Build FreeTDS: './configure --prefix=/usr/local/freetds; make; make + install'. 3. Open /usr/local/freetds/etc/freetds.conf and add a section for the +server you're using. An example: # This is an example Sybase server [SYBASE_EXAMPLE] host = ;host = port = 2025 tds version = 5.0 You'll use the string 'SYBASE_EXAMPLE' in your perl scripts as the +server to connect to, like so: my $dbh = DBI->connect("DBI:Sybase:server=SYBASE_EXAMPLE",'user' +,'pass'); 4. Download the DBD::Sybase tarball from +uthors/id/M/ME/MEWP/DBD-Sybase-0.95.tar.gz. (The online docs are at h +ttp:// 5. Edit DBD::Sybase's dbdimp.c (it's in the top of the untarred direct +ory), and change every cs_ctx_global() you find to cs_ctx_alloc(). Th +ere are probably four occurences to change, so do a global search and + replace. 6. Edit DBD::Sybase's CONFIG file (it's also right on top there). Add +the following lines: SYBASE=/usr/local/freetds EXTRA_LIBS=-linsck 7. Do the standard 'perl Makefile.PL; make; make install'. 8. Run a test script to make sure it all works.

      When doing step 7., I get the following error which (seems) to point to the fact that the Sybase libs cannot be found under freetds (or any subdirectory under which freetds is installed). There is not even a /lib or /lib64 directory under freetds. Please meditate with me and help in resolving this issue, oh enlightened ones.

      Error when compiling (i.e. running perl Makefile.PL): Can't find any Sybase libraries in /usr/local/freetds/freetds-0.91/lib + or /usr/local/freetds/freetds-0.91/lib64 at Makefile.PL line 146, <I +N> line 45.

        Did you look here? That set of directions seems to jive with what I remember from about 10 years ago when I did this last.

        Peter L. Berghold -- Unix Professional
        Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
Re: DBD::Sybase on Linux -- trouble?
by mpeppler (Vicar) on Aug 02, 2012 at 15:39 UTC
    If you're using it for MS-SQL, then the FreeTDS route is appropriate.

    If you're using it for Sybase, then I would recommend getting the Sybase libs - available as part of the Sybase ASE free download on the Sybase site. With Sybase libs it's a pretty simple CPAN install.


      I am using this to try to connect to Sybase, yes. So can I still use FreeTDS with the ASE or ASA client?

        Sorry - I don't understand the question.

        You can use FreeTDS and the ASE Client libs (OpenClient) provide the same functionality, so it's really one or the other. Unless you meant something else, of course...


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://984878]
Approved by marto
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2018-06-22 12:16 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (124 votes). Check out past polls.