Re: [greenstone-users] DBPlug

From John R. McPherson
DateWed, 30 Jun 2004 08:50:19 +1200
Subject Re: [greenstone-users] DBPlug
In-Reply-To (0862AC18E0348845AFB0EEF3F2FFA1A8017BAF6E-hbm-exchange2-heenan-ca)
On Tue, Jun 29, 2004 at 11:00:43AM -0400, Gamache, Michel (Heenan Blaikie) wrote:
> Has anybody successfully tried to create a collection using the DBPlug
> plugin?

I wrote the plugin specifically for my own little task of getting
rows out of a postgres database, but I tried to write the plugin in
such a way that it should work in a more abstract way.

> Here's my situation:
> I have Greenstone 2.51 running on Windows XP
> I'm trying to connect to a local MySQL database.
> DBI-MySQL is already installed. I have a .dbi file residing in the import
> directory (the only file there) and I'm pretty sure that all my parameters
> are right. when running "", it says that it processed 1 file, 0
> were added in the database and 1 was unrecognized.
> The collect.cfg file only calls the ZIPPlug, GAPlug and DBPlug plugins.
> The Fail.log file says that no plugin could recognise this file

You should at the very least always have GAPlug, ArcPlug, and RecPlug
in every collection's collect.cfg file, unless you are really sure you
know what you are doing.
GAPlug is required for reading files in greenstone's archive file format,
ArcPlug is required for building a collection (for reading the archives/
directory) and RecPlug is required for recursively going through directories.

The DBPlug should return the number of greenstone documents extracted,
which should correspond to the number of rows extracted from the
database source.

Without more information, it is difficult to determine what is causing
your problem. It could be a greenstone configuration problem, a
problem with your SQL query, or a problem with your perl/DBI setup
or mysql setup.

According to the manual page for the DBI MySQL driver, you need to set the
data source in the DBPlug configuration file to something like
"DBI:mysql:database=$databasename;host=$host" for appropriate values
of $databasename and $host. For postgres I had to do
"DBI:Pg:dbname=databasename". You might also need to use "mSQL" instead
of "mysql", although I'm unsure as to what the difference is between the
two drivers.

I've never tried using perl's DBI stuff with mysql, but if you provide
me with more information I'll try to help.

John McPherson