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

From: James Willmore (jwillmore_at_fastmail.us)
Date: 11/30/04


Date: Tue, 30 Nov 2004 12:39:36 -0500

On Tue, 30 Nov 2004 16:57:22 +0000, Alex Hunsley wrote:

> Alan Mead wrote:
>> On Tue, 30 Nov 2004 16:27:51 +0000, Alex Hunsley wrote:
>>
>>
>>>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).
>>
>>
>> SQLite doesn't connect to other RDBMS... it's claim to fame is that it is
>> it's own RDBMS. So the error you're getting says "There is no SQLite
>> database of that name" which is true because it's a *MySQL* database.
>>
>> You need to pick one, MySQL or SQLite for your project. Both come with a
>> client and a DBD library for accessing them in Perl.
>
> I've recently realised my folly :)
> Basically, I just want to be able to access an sql database from perl. I
> thought it would be simple to get going :[
> Been trying to get DBD::mysql going; latest is to download DBD::mysql
> manually and configure it that way, but problems with that too.
> Unfortunately I don't have time to spend ages just getting perl to talk
> to an SQL server due to a looming deadline, so I may just have to ditch
> the perl idea and find something else I can get working quickly.
> I don't suppose you know of a simple-to-get-working module that would
> fulfill my wildest SQL server connection dreams?

A few suggestions ....

1) You *might* be able to use the DBD::Proxy module to connect.
Basically, if you can install DBD::mysql on the machine that has MySQL
installed, you could run a proxy on that box and have the clients
(scripts) connect to the proxy. I can't say I've ever done it, but I've
read about it :-)

2) Try another DBD module. For example, you might be able to use the
DBD::JDBC module to connect to the MySQL database. Now all you need to do
is use the appropriate Java driver for connection (far easier to install
:-) ). Or DBD::ODBC. *Most* RDBMS's support ODBC connections. Simple if
you're on a Windows box, a little more effort of you use *nix box.

3) Use the MySQL client application within Perl using 'system' or 'open'
or some other method used to execute commands within Perl.

4) For pre-made scripts and applications, visit Freshmeat
(http://freshmeat.net). I'm sure you'll find something there :-)

Of course, you could just follow the directions given in the DBD::mysql
README to install the proper driver :-) And contact the suthor of the
module if you're having that much trouble installing it :-)

HTH

Jim



Relevant Pages

  • DBI / DBD / MySQL installation problem
    ... I used to run Red Hat 9, and had a perfect relationship with Perl, DBI, ... able to connect to MySQL from Perl via DBI. ... Running install for module Mysql ...
    (perl.dbi.users)
  • Installing Puresecure on Solaris 8
    ... Getting puresecure installed on Solaris was very difficult. ... I had to manually install a number of things. ... CONFIGURING MYSQL: ... INSTALLING PERL MODULES ...
    (comp.security.misc)
  • Problems installing DBD::mysql on Solaris 10
    ... I am in the process of building a server and am trying to get Perl, ... I proceeded to install mysql, ... new copy of perl, using gcc. ...
    (comp.lang.perl.modules)
  • Trying to get DBI (and then DBD::mysql) to install under Cygwin
    ... MySQL using phpMyAdmin. ... I'd like to be able to run short shell-executed programs (Perl ... e.g. commands like: "LOAD DATA INFILE 'input.txt' INTO TABLE ... I have been trying to install DBI via the command given in DuBois' ...
    (perl.dbi.users)
  • Ruby, SQLite, and MAMP
    ... I'm running a Ruby development environment on my computer and have MySQL ... I am unable to install the sqlite gem, ... Failed to build gem native extension. ...
    (comp.lang.ruby)