DBD::mysql::st 执行失败:表 ''不存在
如果这对你们来说可能是一个愚蠢的问题,我很抱歉,但我不知道该怎么办。我正在尝试使用 perl 连接到本地数据库。当我尝试运行命令时,出现以下错误
DBD::mysql::st execute failed: Table 'RegenMedline.user_tables' doesn't exist at Medlineparser.pl line 639.
:我的第 639 行是这样的:
$main::dbh = DBI->connect("dbi:mysql:databasename",
$main::user="username",
$main::password="password",
{PrintError => 1,
RaiseError => 1,
AutoCommit => 1})
or die "Can't connect to database: $DBI:errstr\n";
my $sth = $main::dbh->prepare("
SELECT table_name
FROM user_tables");
$sth->execute();
while (my ($table_name) = $sth->fetchrow_array()){
print "table_name = $table_name\n";
}
我希望这个片段有帮助,并且我已经以正确的方式提出了我的问题。如果我需要提供更多信息,请现在告诉我。非常感谢任何帮助。
I am sorry if this may be a silly question for you all,but I don't know what to do. I am trying to connect to a local database using perl. When I try to run the command I get below error
DBD::mysql::st execute failed: Table 'RegenMedline.user_tables' doesn't exist at Medlineparser.pl line 639.
My line 639 is something like this:
$main::dbh = DBI->connect("dbi:mysql:databasename",
$main::user="username",
$main::password="password",
{PrintError => 1,
RaiseError => 1,
AutoCommit => 1})
or die "Can't connect to database: $DBI:errstr\n";
my $sth = $main::dbh->prepare("
SELECT table_name
FROM user_tables");
$sth->execute();
while (my ($table_name) = $sth->fetchrow_array()){
print "table_name = $table_name\n";
}
I hope this snippet helps and I have put my question in right way. Let me now if I need to give more information. Any help is greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它可以从命令行运行吗?
Does it work from command line?