LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1850|回复: 2

Perl连接Mysql的问题

[复制链接]
发表于 2009-6-22 15:49:15 | 显示全部楼层 |阅读模式
se DBI

my $dbName="dh";
my $Server="127.0.0.1";
my $Port="3306";

my $Data="DBI:mysqldbNameServerPort";
my $dbUserName="admin";
my $dbUserPass="webadmin";
my $Conn=DBI->connect($data,$dbUserName,$dbUserPass);
my $Sql="select id,user from users; ";
my $Rs=$Conn->prepare($Sql);


$Rs->execute() or die "Unable execute SQL: $Rs->errstr";
while (($row = $Rs->fetchrow_arrayref)){
    print "$row->['0']  $row->['1']  $orw->['2']\n";
}

出错信息为:perl 123
"dh" is not exported by the DBI module
Can't continue after import errors at 123 line 3
BEGIN failed--compilation aborted at 123 line 3.
 楼主| 发表于 2009-7-8 15:17:11 | 显示全部楼层
这是什么问题呀!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-7-14 11:12:39 | 显示全部楼层
问题解决了。原来是自己大意了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表