暂无图片
Linux系统下perl脚本连接OB数据库
我来答
分享
暂无图片 匿名用户
Linux系统下perl脚本连接OB数据库

Perl脚本怎么连接OB 麻烦提供下例子代码 谢谢

我来答
添加附件
收藏
分享
问题补充
1条回答
默认
最新
O
OceanBase社区传送门

#!/usr/bin/perl -w
use strict;
use DBI;
my $host = “localhost”;
my $driver = “mysql”;
my $database = “RUNOOB”;
my $dsn = “DBI:$driver:database=$database:$host”;
my $userid = “root”;
my $password = “123456”;
连接数据库
my $dbh = DBI->connect($dsn, $userid, $password ) or die $DBI::errstr;
my $sth = $dbh->prepare(“SELECT * FROM Websites”);
$sth->execute();
while ( my @row = $sth->fetchrow_array() )
{
print join(’\t’, @row)."\n";
}
$sth->finish();
$dbh->disconnect();

暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏