linux下使用perl连接mysql,如果不用DBI模块,还有什么办法能够保持数据库连接状态?麻烦有知道的吗,谢谢 15
2个回答
展开全部
#
# Don't be stupid
# DBI comes by default with ActiveState_Perl
#
#/usr/bin/perl -w
use strict;
use DBI;
my $DSN = "DBI:mysql:Database;host=localhost";
my $dbh = DBI->connect($DSN, "UserName", "passwd",
{ PrintError => 0,
RaiseError => 1
} );
# Don't be stupid
# DBI comes by default with ActiveState_Perl
#
#/usr/bin/perl -w
use strict;
use DBI;
my $DSN = "DBI:mysql:Database;host=localhost";
my $dbh = DBI->connect($DSN, "UserName", "passwd",
{ PrintError => 0,
RaiseError => 1
} );
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询