【问题标题】:use perl to connect oracle with LDAP使用 perl 连接 oracle 和 LDAP
【发布时间】:2025-12-31 06:55:17
【问题描述】:

我想通过 perl 将 oracle db 与 LDAP 连接,但出现以下问题:

没有这样的数据库(dbase123456)!在 /home/cy/scripts/test/lib/DBD/LDAP.pm 第 401 行,第 253 行。 DBI connect('dbase123456','cy',...) 失败:没有这样的数据库 (dbase123456)!在 ./test.pl 第 28 行 无法对 ./test.pl 第 29 行第 253 行的未定义值调用方法“prepare”。

perl 脚本是:

my $query = GetQuery();

my $dbh = DBI->connect("DBI:LDAP:dbase123456",'cy','cy');

my $sth = $dbh->prepare($query);

$sth->execute();

my $rows_ = $sth->fetchall_arrayref();

$sth->finish();

请有人帮我检查根本原因,非常感谢。

【问题讨论】:

  • 您确定您使用的是正确的数据库名称吗?因为它清楚地给出了 Database not found 错误

标签: linux perl ldap


【解决方案1】:

估计你还没有创建配置文件dbase123456.ldb

看看GETTING STARTED from the documentation for the DBD::LDAP driver

【讨论】: