问题描述
#!/usr/bin/perl
use strict;
use DBI;
use warnings;
my $user = "database_user";
my $pass = "database_password";
my $server = "ip";
my $database_name = "db";
my $connectString = "driver={GBase ODBC 8.3 Driver};server=$server;database=$database_name;uid=$user;pwd=$pass";
my $dbh = DBI->connect("DBI:ODBC:$connectString")|| die "Connect Failed: $DBI::errstr\n";
install_driver(ODBC) Failed: Can't locate DBD/ODBC.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 3) line 3.
Perhaps the DBD::ODBC perl module hasn't been fully installed,or perhaps the capitalisation of 'ODBC' isn't right.
Available drivers: DBM,ExampleP,File,Gofer,Proxy,sqlite,Sponge.
然后我尝试运行 perl -e 'use DBD::ODBC;'
并得到同样的错误:
在@INC 中找不到 DBD/ODBC.pm(@INC 包含: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) 在 -e 第 1 行。开始 失败——编译在 -e 第 1 行中止。
有人可以帮我解决吗?