SQLite - problem connecting to database (or doing a select)

From: Alex Hunsley (lardattardisdoteddotacdotuk_at_mailinator.com)
Date: 11/30/04


Date: Tue, 30 Nov 2004 16:27:51 +0000

I've having a problem running a tiny snippet of test code that uses
SQLite to connect to a local database (I'm running xampp on my local
machine which includes mysql).

Firstly, just to demonstrate that I really do have a live database which
is running:

$ mysql -h 127.0.0.1
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16 to server version: 4.0.20a-debug-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use pmaster;
Database changed
mysql> show tables;
+---------------------+
| Tables_in_pmaster |
+---------------------+
| campaigns |
| data |
| logging |
+---------------------+
3 rows in set (0.00 sec)

mysql>

Now, I've installed SQLite and am running this perl code:

----8<----

use DBI;

my $dbh = DBI->connect('dbi:SQLite:pmaster',
     '', '') || die("problem: ".DBI->errstr);

$results = $dbh->selectall_arrayref('SELECT * FROM data');

print "results=".$results."\n";

----8<----

when I run this, the output is as follows:

$ ./sqlTest.pl
DBD::SQLite::db selectall_arrayref failed: no such table: data(1) at
dbdimp.c line 263 at ./sqlTest.pl line 24.
results=

No such table it says, yet clearly the database pmaster is there and
does contain a table called data (see the mysql monitor stuff at the top).



Relevant Pages

  • DBConvert for SQLite & MySQL 1.0.0
    ... DBConvert for SQLite & MySQL is a database migration tool which ... The tool is also applicable for MySQL database ... preverification of possible conversion errors, ...
    (comp.software.shareware.announce)
  • Re: OT PDO and sqlite
    ... server that does not have the PDO driver for MySQL, ... Personally, I have my own abstract database class (yes, yet another ... on a server) and subclasses for both MySQL and SQLite ...
    (comp.lang.php)
  • Re: MySQL Database problem (probably already solved in a message, but this is somewhat urgent)
    ... MySQL server has a database with a table, ... columns, an FSR column, and a password column. ... checked if the supposed arrays that were returned were actually arrays ...
    (comp.lang.php)
  • RE: FreeBSD 5.3 MySQL Performance
    ... versions of Linux and FreeBSD for most tests. ... > popular with the ATA disk drive manufacturers. ... > Many companies have used FreeBSD and MySQL for years and years. ... it is not often that you have such a small database and such a large ...
    (freebsd-questions)
  • Re: how to migrate request-tracker database from sqlite3 to mysql
    ... I'm trying to migrate request-tracker3.6 database from sqlite to mysql ... some reason importing into mysql didn't work twice. ...
    (Debian-User)