Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Need Help for connecting MSSQL SERVER From Linux(ubuntu)

by perlraj (Acolyte)
on Sep 17, 2012 at 06:43 UTC ( #993978=perlquestion: print w/replies, xml ) Need Help??
perlraj has asked for the wisdom of the Perl Monks concerning the following question:

I just installed the ODBC driver in the Ubuntu, but still I am facing issues while connecting the database from Perl. Here is the description on what I have done in my machine.

I installed the MSSQL Driver and Unix ODBC from easysoft website. The path details in my machine follows:

ODBC Installed Path:- user/local/easysoft/unixodbc

Data Source and Driver path: user/local/etc Sample Code:

#!/usr/bin/perl use strict; use DBI; my $dsn="DBI:ODBC:DRIVER={SQL Server};,1433;data +base=DB_name"; my $dbh = DBI->connect($dsn, "username", "password" ,{AutoCommit => 1} +) or die $DBI::errstr;

Error: DBI connect('DRIVER={SQL Server};,1433;database=DB_name','username',...) failed: unixODBCDriver Manager Can't open lib 'SQL Server' : file not found (SQL-01000) at line 5 unixODBCDriver ManagerCan't open lib 'SQL Server' : file not found (SQL-01000) at line 5. Title: Need help in connecting MSSQL database from Linux OS (Ubuntu)

Replies are listed 'Best First'.
Re: Need Help for connecting MSSQL SERVER drom Linux(ubuntu)
by McDarren (Abbot) on Sep 17, 2012 at 07:02 UTC

      Agreed. The ODBC driver works great for connecting to Microsoft SQL Server on Windows, but on Linux the Sybase driver seems a lot more reliable.

      perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

      Hi thanks a lot for your solution, but i have lot of scripts implemented using DBD::ODBC,so need to be done with DBD::ODBC.

      I have problem with creating and accessing datasouce.



Re: Need Help for connecting MSSQL SERVER From Linux(ubuntu)
by mje (Curate) on Sep 17, 2012 at 09:46 UTC

    Your code is attempting to use the driver called "SQL Server" so you need a driver called that in your /etc/odbcinst.ini file. The Easysoft one is usually called "Easysoft ODBC-SQL Server" so check your odbcinst file and either change that to match your code or change your code to match the driver name.

      Hi thanks a lot, but i received this error:

      unixODBCEasysoftSQL Server DriverSQL ServerGeneral error: OS Version mismatch: Please report this sequence (AAAG, LX, 3, -1, -1) to Easysoft support at (SQL-HY000) and i have reported it to them

        Seems pretty explicit, did you report this as requested? A search engines shows similar problems on their knowledge base. Have you check there?

        You need a version which supports Linux kernel 3 (I'd guess). Mail and they can sort you out.

by LanX (Bishop) on Sep 17, 2012 at 09:04 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://993978]
Approved by McDarren
[hippo]: Self-liberation is the best.
[hippo]: Corion: Different timestamps maybe?

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2018-04-25 08:48 GMT
Find Nodes?
    Voting Booth?