Mysql Processing using DBPlug

This describes my experience of getting DBPlug to get records for a mysql database.


 * My test mysql is installed on wesson.cs.waikato.ac.nz
 * My greenstone is installed in /research/shaoqun/testing/gsdl/collect/testsql (on Linux).
 * My test database is called gswikidb.
 * My test database table is gw_user.

$db='DBI:mysql:gswikidb:wesson.cs.waikato.ac.nz'; $username='root'; (I used root without a password to log in. You may need to set $password if authentication is required.) $sql_query = 'SELECT * FROM gw_user'; %db_to_greenstone_fields=(    "user_name" => "Title",     "user_real_name" => "text",     "user_id" => "Identifier", ); (This is a mapping between field names in gw_user, and metadata names in the Greenstone archive files.)
 * I copied /research/shaoqun/testing/gsdl/etc/packages/example.dbi into the import directory of my collection testsql.
 * This file was modified by setting the following variables:


 * Then I built the collection.

Notes about Perl modules. perl Makefile.PL INSTALLSITELIB="$GSDLHOME/perllib/cpan/perl-5.8" PREFIX="$GSDLHOME/perllib/cpan/XXX" SITEPREFIX="$GSDLHOME/perllib/cpan" make make test make install perl Makefile.PL --testdb=gswikidb --testhost=wesson.cs.waikato.ac.nz --testuser=root INSTALLSITELIB="$GSDLHOME/perllib/cpan/perl-5.8" PREFIX="$GSDLHOME/perllib/cpan/XXX" SITEPREFIX="$GSDLHOME/perllib/cpan" make make test make install
 * download following modules from CPAN DBI Data::ShowTable DBD::mysql
 * install these modules: make sure you have run 'setup.bat' or 'source setup.bash' in your greenstone directory first)
 * put them in $GSDLHOME/packages/cpan.
 * untarred them (tar xzvf file.tar.gz)
 * for DBI and Data:ShowTable, run
 * for DBD:mysql, run

This installs the modules into $GSDLHOME/perllib/cpan/perl-5.8 (XXX in the perl line should be set to the first component of the module name, e.g. DBI,DBD,Data)