Perl And Sqlite
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.
精彩评论