开发者

Perl And Sqlite

开发者 https://www.devze.com 2023-03-17 13:18 出处:网络
Can someone tell me how to access a sqlite3 database from perl. the code use DBI; use DBD::SQLite; my $dbh = DBI->connect(

Can someone tell me how to access a sqlite3 database from perl.

the code

use DBI;
use DBD::SQLite;

my $dbh = DBI->connect(
  "dbi:SQLite:dbname=/cb开发者_开发问答illdata/media/database/collector.db","",""
) or die "Cannot connect: $DBI::errstr";

returns error

DBI connect('dbname=/cbilldata/media/database/collector.db','',...) failed: database disk image is malformed at ./db.pl line 7

Cannot connect: database disk image is malformed at ./db.pl line 7.


Either your version of DBD::SQLite is a very old one that uses SQLite 2 and not 3, or the message is accurate and your database is corrupt.

0

精彩评论

暂无评论...
验证码 换一张
取 消