简体   繁体   English

无法使用域用户在Linux上使用perl Sybase dbi连接到mssql 2008

[英]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. 我需要在CentOS机器上使用perl(12.2)和freetds 0.91连接到mssql 2008数据库,并且可以使用在数据库上定义的用户成功完成。 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. 我相信tds错误(LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (34))表示登录失败,但我确定密码是正确的并且直接在mssql客户端上尝试过。 Anyone get this to work? 有人这个上班吗?

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 ... 我发现从Linux连接到SQL服务器(DBD :: ODBC)的唯一成功方法是使用ODBC,SyBase模块应该与Sybase的实例一起使用,而不是与SQL Server一起使用...

The connection string to use with ODBC should looks like the following : 与ODBC一起使用的连接字符串应如下所示:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM