Dan Littlejohn
Dan Littlejohn

Reputation: 1409

cannot connect using perl Sybase dbi on Linux to mssql 2008 using a domain user

I need to connect to a mssql 2008 database using perl (12.2) and freetds 0.91 on a CentOS box and can do it successfully with a user defined on the database. However, I need to switch to a domain user and I have not been able to figure out what I need to do to get it to work. It looks to be correctly setup on the database and here is my connection string:

my $dsn = [
    "DBI:Sybase:database=adx;server<server_name>",
    '<DOMAIN>\\<user>',
    '<password>',
    {
        PrintError  => 0,
        RaiseError  => 0,
        AutoCommit  => 0
    }
];

Here is the error message:

database connection failed for DBI:Sybase:database=<db_name>;server=<server_name>
<DOMAIN>\\<user> : OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (34)
Server <server_name>, database
Message String: Adaptive Server connection failed

I believe the tds error (LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (34)) is indicating the login failed, but I am sure the password is correct and have tried it directly on a mssql client. Anyone get this to work?

Upvotes: 3

Views: 4254

Answers (1)

aleroot
aleroot

Reputation: 72636

The only successful way that i have found to connect to SQL server(DBD::ODBC) from Linux is using ODBC, the SyBase module should be used with an instance of Sybase and not with SQL Server ...

The connection string to use with ODBC should looks like the following :

 "DBI:ODBC:driver={SQL Server};Server=192.168.1.1,1433;database=db_name";

Upvotes: 2

Related Questions