User Tools

Site Tools


en:user_advanced:greenstonesqlplugs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:user_advanced:greenstonesqlplugs [2018/12/06 02:49] anupamaen:user_advanced:greenstonesqlplugs [2023/03/13 01:46] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +
 +
 +
 ====== Editing archives metadata and/or fulltext using a MySQL database ====== ====== Editing archives metadata and/or fulltext using a MySQL database ======
 Like the GreenstoneMETSPlugin, the GreenstoneSQLPlugin is another alternative to using the GreenstoneXMLPlugin. Like the GreenstoneMETSPlugin, the GreenstoneSQLPlugin is another alternative to using the GreenstoneXMLPlugin.
Line 7: Line 10:
  
 **Important Notes:** **Important Notes:**
 +  * None of this has been tested with Greenstone 2, only Greenstone 3. But it should in theory work with Greenstone 2 as well. Greenstone 2 users are invited to email the mailing list if there are any issues. UPDATE: Some testing for GS2 performed after fixing issues, as identified on mailing list. User seemed to succeed in using the GS SQL Plugs with a GS2 nightly binary.
   * GreenstoneSQLPlugin and GreenstoneSQLPlugout rely on the **DBI** and DBD::mysql perl packages.   * GreenstoneSQLPlugin and GreenstoneSQLPlugout rely on the **DBI** and DBD::mysql perl packages.
   * We've so far tested the GreenstoneSQLPlugs on Ubuntu Linux, Windows 7 64 bit and MacOS v.10.13/High Sierra with **mysql version 5.7.23 and perl DBI version 1.634 and perl DBD::mysql version 4.033.** We found DBD::mysql version 4.033 to have the necessary support for UTF8, whereas somewhat earlier versions didn't. (For this reason we're upgrading the version of Strawberry Perl from 5.18 to 5.22 which we include with Windows Greenstone binaries here onward, starting with GS3.09)   * We've so far tested the GreenstoneSQLPlugs on Ubuntu Linux, Windows 7 64 bit and MacOS v.10.13/High Sierra with **mysql version 5.7.23 and perl DBI version 1.634 and perl DBD::mysql version 4.033.** We found DBD::mysql version 4.033 to have the necessary support for UTF8, whereas somewhat earlier versions didn't. (For this reason we're upgrading the version of Strawberry Perl from 5.18 to 5.22 which we include with Windows Greenstone binaries here onward, starting with GS3.09)
Line 12: Line 16:
      * For Windows binaries, we provide you with a Strawberry Perl that has the correct versions of DBI and DBD::mysql. If you're working with Greenstone source distributions or source code from svn on Windows, you can grab Strawberry Perl 5.22 [[http://trac.greenstone.org/export/32658/main/trunk/release-kits/shared/windows/perl.zip|from here]], which includes versions of these packages that we tested the Greenstone SQL Plugs successfully against.      * For Windows binaries, we provide you with a Strawberry Perl that has the correct versions of DBI and DBD::mysql. If you're working with Greenstone source distributions or source code from svn on Windows, you can grab Strawberry Perl 5.22 [[http://trac.greenstone.org/export/32658/main/trunk/release-kits/shared/windows/perl.zip|from here]], which includes versions of these packages that we tested the Greenstone SQL Plugs successfully against.
      * For newer versions of Mac, your pre-installed DBI package may be fine, but you may be missing DBD::mysql. Or perhaps you have an older version of DBD::mysql. In that case, refer to the Mac instructions at [[http://wiki.greenstone.org/doku.php?id=en:user_advanced:greenstonesqlplugs#getting_and_running_mysql | Getting and running MySQL]] on how to get DBD::mysql on Mac 10.13/High Sierra.      * For newer versions of Mac, your pre-installed DBI package may be fine, but you may be missing DBD::mysql. Or perhaps you have an older version of DBD::mysql. In that case, refer to the Mac instructions at [[http://wiki.greenstone.org/doku.php?id=en:user_advanced:greenstonesqlplugs#getting_and_running_mysql | Getting and running MySQL]] on how to get DBD::mysql on Mac 10.13/High Sierra.
 +     * **UPDATE:** If you're on Linux or on a Mac High Sierra machine, and you don't have DBI or DBD, also refer to the instructions at [[http://wiki.greenstone.org/doku.php?id=en:user_advanced:greenstonesqlplugs#building_the_dbdmysql_package_for_mac_os_v_1013_high_sierra | Building the DBD (and DBI) perl packages]]. Compiling DBD and the Greenstone SQL plugs' use of it were already tested for the Mac. The compiling process for //DBI// has now been tested successfully, but nothing more: not tested that the plugs run after compiling up DBI in this way on a machine that didn't use to have DBI.
  
 You can check you have the DBI and DBD::mysql packages installed as part of your perl in whatever OS you're working on. To test you have DBI and DBD::mysql installed and also find their versions, run the following command in perl: You can check you have the DBI and DBD::mysql packages installed as part of your perl in whatever OS you're working on. To test you have DBI and DBD::mysql installed and also find their versions, run the following command in perl:
Line 25: Line 30:
  
 ===== The short version: Usage instructions ===== ===== The short version: Usage instructions =====
 +  * The perl packages DBI version 1.634 and DBD::mysql version 4.033 must be installed. They come with Windows GS3 binaries, and these packages may already be present on your Mac or Linux machine (if not see [[http://wiki.greenstone.org/doku.php?id=en:user_advanced:greenstonesqlplugs#building_the_dbdmysql_package_for_mac_os_v_1013_high_sierra|here]]).
 +  * Rename the files ''GreenstoneSQLPlugin.pm.inactive'' and ''GreenstoneSQLPlugout.pm.inactive'' by removing the ''.inactive'' suffix.
   * At present there's only support for a MySQL database. There's [[#getting_and_running_mysql|instructions on obtaining and running MySQL]] if you need it.   * At present there's only support for a MySQL database. There's [[#getting_and_running_mysql|instructions on obtaining and running MySQL]] if you need it.
   * Make sure you're [[#running|running your MySQL server]] and have moreover launched it with the character set encoding set to ''utf8mb4'':\\ <code>./mysqld_safe --datadir=/Path/to/mysql/data --character_set_server=utf8mb4</code>   * Make sure you're [[#running|running your MySQL server]] and have moreover launched it with the character set encoding set to ''utf8mb4'':\\ <code>./mysqld_safe --datadir=/Path/to/mysql/data --character_set_server=utf8mb4</code>
   * After creating a new Greenstone collection, open up ''collectionConfig.xml'' for editing, as in the example snippet below   * After creating a new Greenstone collection, open up ''collectionConfig.xml'' for editing, as in the example snippet below
      * add in an element for the **GreenstoneSQLPlugout**      * add in an element for the **GreenstoneSQLPlugout**
-     * //replace// the GreenstoneXMLPlugin element with one for **GreenstoneSQLPlugin**. (It should notably take GreenstoneXMLPlugin's place near the top)+     * **//replace// the GreenstoneXMLPlugin** element with one for **GreenstoneSQLPlugin**. (It should notably take GreenstoneXMLPlugin's place near the top)
      * **The configure options for both GreenstoneSQLPlugs are the same and need to be set consistently for both.**\\ Snippet of example configuration in ''collectionConfig.xml'':\\ <code>      * **The configure options for both GreenstoneSQLPlugs are the same and need to be set consistently for both.**\\ Snippet of example configuration in ''collectionConfig.xml'':\\ <code>
     <import>     <import>
Line 38: Line 45:
      <option name="-db_driver" value="mysql"/>      <option name="-db_driver" value="mysql"/>
      <option name="-db_client_user" value="root"/>      <option name="-db_client_user" value="root"/>
-     <option name="-db_client_pwd" value="6reenstone3"/>+     <option name="-db_client_pwd" value="TYPE_YOUR_MYSQL_PASSWORD_HERE"/>
      <option name="-db_host" value="127.0.0.1"/>      <option name="-db_host" value="127.0.0.1"/>
      [<option name="-db_port" value="PORT_NUMBER"/>]      [<option name="-db_port" value="PORT_NUMBER"/>]
Line 51: Line 58:
  <option name="-db_driver" value="mysql"/>  <option name="-db_driver" value="mysql"/>
  <option name="-db_client_user" value="root"/>  <option name="-db_client_user" value="root"/>
- <option name="-db_client_pwd" value="TYPE_THE_PASSWORD_HERE"/>+ <option name="-db_client_pwd" value="TYPE_YOUR_MYSQL_PASSWORD_HERE"/>
  <option name="-db_host" value="127.0.0.1"/>  <option name="-db_host" value="127.0.0.1"/>
  [<option name="-db_port" value="TYPE_MYSQL_SERVER_PORT_NUMBER"/>] <!--Optional-->  [<option name="-db_port" value="TYPE_MYSQL_SERVER_PORT_NUMBER"/>] <!--Optional-->
Line 62: Line 69:
 </code>\\ //Optional// options are in [square brackets].  </code>\\ //Optional// options are in [square brackets]. 
  
-  * Run (incremental-)import and (incremental-)build normally:\\ <code>(incremental-)import.pl -site <SITENAME> <COLNAME> +  * Once the collectionConfiguration.xml file has been correctly setup, you can run GLI, open the hand configured collection in there, and then run build in there.\\ Alternatively, you can use the commandline and run (incremental-)import and (incremental-)build normally:\\ <code>import.pl -site <SITENAME> <COLNAME> 
-(incremental-)buildcol.pl -activate -site <SITENAME> <COLNAME></code>\\ **IMPORTANT: On Windows**, precede the import and buildcol commands with ''perl -S''.\\ The default sitename is ''localsite''. Leave out the ''-site <SITENAME>'' for Greenstone 2.+buildcol.pl -activate -site <SITENAME> <COLNAME></code>where COLNAME is the collection name.\\ Or if building incrementally:<code>incremental-import.pl -incremental -site <SITENAME> <COLNAME> 
 +incremental-buildcol.pl -activate -site <SITENAME> <COLNAME></code>Alternatively, you can run both import and buildcol steps in one go:<code>full-rebuild.pl -site <SITENAME> <COLNAME></code>And if incrementally building in one go:<code>incremental-rebuild.pl -site <SITENAME> <COLNAME></code>\\ **IMPORTANT: On Windows**, precede the import and buildcol or rebuild commands with ''perl -S''.\\ The default sitename is ''localsite''. Leave out the ''-site <SITENAME>'' for Greenstone 2.
   * Start your GS3 server if you haven't already and preview your collection.   * Start your GS3 server if you haven't already and preview your collection.
-  * You can now at any time [[#running|run your MySQL client]] **in utf8mb4 mode** then use it to access modify the contents of the SQL database as you wish (such as using SQL statements to mass-edit metadata) and then rebuild the collection with the changed values in effect:+  * You can now at any time [[#running|run your MySQL client]] **in utf8mb4 mode** then use it to access and modify the contents of the SQL database as you wish (such as using SQL statements to mass-edit metadata) and then rebuild the collection with the changed values in effect:
      * But **once you log into MySQL client, always first set the connection to use the ''utf8mb4'' character set** before creating or loading databases and tables:\\ <code>mysql> set names utf8mb4;</code>      * But **once you log into MySQL client, always first set the connection to use the ''utf8mb4'' character set** before creating or loading databases and tables:\\ <code>mysql> set names utf8mb4;</code>
-     * The GreenstoneSQLPlugs create a **database** called ''<SITENAME>'' for GS3 and called ''greenstone2'' for GS2.+     * The GreenstoneSQLPlugs create a **database** called ''<SITENAME>'' for GS3 (which defaults to ''localsite''and called ''greenstone2'' for GS2.
      * Up to 2 **tables** are created for each collection: ''<COLNAME>_metadata'' and ''<COLNAME>_fulltxt'' (note spelling), where hyphens '-' in <COLNAME> are replaced by underscores '_'.      * Up to 2 **tables** are created for each collection: ''<COLNAME>_metadata'' and ''<COLNAME>_fulltxt'' (note spelling), where hyphens '-' in <COLNAME> are replaced by underscores '_'.
  
 **Notes on GreenstoneSQLPlugin/out configuration options:** **Notes on GreenstoneSQLPlugin/out configuration options:**
   * Set ''process_mode'' to one of ''meta_only'', ''text_only'' or ''all'', depending on whether you want only metadata, only full text or both to be stored in your MySQL database for each document in your collection. The remainder will be stored in the ''docsql.xml'' file per document in your collection's ''archives'' subfolder.   * Set ''process_mode'' to one of ''meta_only'', ''text_only'' or ''all'', depending on whether you want only metadata, only full text or both to be stored in your MySQL database for each document in your collection. The remainder will be stored in the ''docsql.xml'' file per document in your collection's ''archives'' subfolder.
-  * The values for ''-db_driver'', ''-db_client_user'', ''-db_client_pwd'', ''-db_host'' and the optional ''-db_port'' are the connection parameters you use when running the MySQL client against the running MySQL server.\\ - Where there are default values for options, the defaults are set for the value attribute in the example below. Adjust the options' values as appropriate for you.+  * The values for ''-db_driver'', ''-db_client_user'', ''-db_client_pwd'', ''-db_host'' and the optional ''-db_port'' are the connection parameters you use when running the MySQL client against the running MySQL server.\\ - Where there are default values for options, the defaults are set for the value attribute in the example collection configuration snippet above. Adjust the options' values as appropriate for you.
   * Experimental feature: If you set ''rollback_on_cancel'' to true, then if you cancel building during the import.pl or first phase of building, the database would remain unchanged since the start of //that// script. It has no real effect during the latter phase of building, which runs buildcol.pl, since buildcol.pl does not attempt to change the database, merely reading content back from MySQL. When running with the ''rollback_on_cancel'' option enabled, you will be reminded that to keep your file system in sync with database changes, you would need to manually backup the collection's ''archives'' and/or ''index'' folders.   * Experimental feature: If you set ''rollback_on_cancel'' to true, then if you cancel building during the import.pl or first phase of building, the database would remain unchanged since the start of //that// script. It has no real effect during the latter phase of building, which runs buildcol.pl, since buildcol.pl does not attempt to change the database, merely reading content back from MySQL. When running with the ''rollback_on_cancel'' option enabled, you will be reminded that to keep your file system in sync with database changes, you would need to manually backup the collection's ''archives'' and/or ''index'' folders.
  
Line 79: Line 87:
 ==== Prerequisites ==== ==== Prerequisites ====
   * You need to have MySQL 5.5 or greater installed (for utf8mb4 support). We tested with mysql version 5.7.23. See [[#getting_and_running_mysql|instructions on obtaining and running MySQL]].   * You need to have MySQL 5.5 or greater installed (for utf8mb4 support). We tested with mysql version 5.7.23. See [[#getting_and_running_mysql|instructions on obtaining and running MySQL]].
-  * Your perl must have the DBI package, as discussed at the top of this page.+  * The perl packages DBI version 1.634 and DBD::mysql version 4.033 must be available on your system, as already discussed at the top of this page. (They're included with Windows GS3 binaries.) To find out if they're already installed and that the versions are correct, run in a terminal:\\<code>''perl -MDBI -e "DBI->installed_versions";''</code>\\ If you're on Linux or Mac and don't have DBD or even DBI, refer to [[http://wiki.greenstone.org/doku.php?id=en:user_advanced:greenstonesqlplugs#building_the_dbdmysql_package_for_mac_os_v_1013_high_sierra|Building DBD (and DBI) on Mac and Linux]] on running an included script to automatically install them. 
 +  * Only if DBD and DBI are installed should you make the Greenstone SQL plugs active as follows. (Beware that activating the plugs otherwise can prevent GLI from launching) 
 +     * rename ''perllib/plugins/GreenstoneSQLPlugin.pm.inactive'' to ''perllib/plugins/GreenstoneSQLPlugin.pm'' 
 +     * rename ''perllib/plugouts/GreenstoneSQLPlugout.pm.inactive'' to ''perllib/plugouts/GreenstoneSQLPlugout.pm''
   * Before you build a collection using these plugins, your MySQL server needs to be running. Moreover, it needs to have been launched with the character set encoding set to utf8mb4:\\ <code>./mysqld_safe --datadir=/Path/to/mysql/data --character_set_server=utf8mb4</code>   * Before you build a collection using these plugins, your MySQL server needs to be running. Moreover, it needs to have been launched with the character set encoding set to utf8mb4:\\ <code>./mysqld_safe --datadir=/Path/to/mysql/data --character_set_server=utf8mb4</code>
  
Line 133: Line 144:
      <option name="-db_driver" value="mysql"/>      <option name="-db_driver" value="mysql"/>
      <option name="-db_client_user" value="root"/>      <option name="-db_client_user" value="root"/>
-     <option name="-db_client_pwd" value="6reenstone3"/>+     <option name="-db_client_pwd" value="TYPE_YOUR_MYSQL_PASSWORD_HERE"/>
      <option name="-db_host" value="127.0.0.1"/>      <option name="-db_host" value="127.0.0.1"/>
      [<option name="-db_port" value="TYPE_MYSQL_SERVER_PORT_NUMBER"/>] <!-- optional.       [<option name="-db_port" value="TYPE_MYSQL_SERVER_PORT_NUMBER"/>] <!-- optional. 
Line 145: Line 156:
  <option name="-db_driver" value="mysql"/>  <option name="-db_driver" value="mysql"/>
  <option name="-db_client_user" value="root"/>  <option name="-db_client_user" value="root"/>
- <option name="-db_client_pwd" value="TYPE_THE_PASSWORD_HERE"/>+ <option name="-db_client_pwd" value="TYPE_YOUR_MYSQL_PASSWORD_HERE"/>
  <option name="-db_host" value="127.0.0.1"/>  <option name="-db_host" value="127.0.0.1"/>
  [<option name="-db_port" value="TYPE_MYSQL_SERVER_PORT_NUMBER"/>] <!-- optional.   [<option name="-db_port" value="TYPE_MYSQL_SERVER_PORT_NUMBER"/>] <!-- optional. 
Line 160: Line 171:
 Leave out ''-site <SITENAME>'' for Greenstone 2, whereas for Greenstone 3, the default sitename is ''localsite''. Leave out ''-site <SITENAME>'' for Greenstone 2, whereas for Greenstone 3, the default sitename is ''localsite''.
  
-You can now preview your Greenstoen collection, [[#running|run the MySQL client]] (but after logging in, immediately set the client's database connection to use the ''utf8mb4'' character set to access the database: ''set names utf8mb4;''), then use SQL statements to modify the database contents such as a collection's metadata and finally rebuild and preview your Greenstone collection once more.+You can now preview your Greenstone collection, [[#running|run the MySQL client]] (but after logging in, immediately set the client's database connection to use the ''utf8mb4'' character set to access the database: ''set names utf8mb4;''), then use SQL statements to modify the database contents such as a collection's metadata and finally rebuild and preview your Greenstone collection once more.
  
 b. GLI-SPECIFIC WAY. b. GLI-SPECIFIC WAY.
Line 243: Line 254:
 tar -xvzf mysql-5.7.23-macos10.13-x86_64.tar.gz</code> tar -xvzf mysql-5.7.23-macos10.13-x86_64.tar.gz</code>
      * You may end up with a folder like /Users/me/mysql-5.7.23-macos10.13-x86_64/mysql-5.7.23-macos10.13-x86_64\\ Rename this to /Users/me/mysql-5.7.23:<code>mv /Users/me/mysql-5.7.23-macos10.13-x86_64/mysql-5.7.23-macos10.13-x86_64 /Users/me/mysql-5.7.23</code>      * You may end up with a folder like /Users/me/mysql-5.7.23-macos10.13-x86_64/mysql-5.7.23-macos10.13-x86_64\\ Rename this to /Users/me/mysql-5.7.23:<code>mv /Users/me/mysql-5.7.23-macos10.13-x86_64/mysql-5.7.23-macos10.13-x86_64 /Users/me/mysql-5.7.23</code>
-     * Apple stopped distributing the MySQL database driver (DBD::mysql) perl package with perl in newer versions of MacOS. For instance, Mac High Sierra machines come with perl 5.18 pre-installed, but do not include the DBD::mysql pacakge to support MySQL. You'll consequently need to install and build this package yourself in such cases.\\ First, **test whether your MacOS has the DBD::mysql package, and whether it's an acceptable version, by typing the following in a terminal:**\\ <code>perl -MDBI -e 'DBI->installed_versions';</code>\\ - If there's no mention of ''DBD::mysql'' in the response output, or if the response output //does// contain DBD::mysql but version number displayed alongside it is lower than 4.033, you'll want to first build DBD::mysql before returning to proceed with the instructions below.\\ - If DBD::mysql 4.033 is already installed, proceed with the instructions below. +     * Apple stopped distributing the MySQL database driver (DBD::mysql) perl package with perl in newer versions of MacOS. For instance, Mac High Sierra machines come with perl 5.18 pre-installed, but do not include the DBD::mysql pacakge to support MySQL. You'll consequently need to install and build this package yourself in such cases.\\ First, **test whether your MacOS has the DBD::mysql package, and whether it's an acceptable version, by typing the following in a terminal:**\\ <code>perl -MDBI -e 'DBI->installed_versions';</code>\\ - If there's no mention of ''DBD::mysql'' in the response output, or if the response output //does// contain DBD::mysql but the version number displayed alongside it is lower than 4.033, you'll want to [[http://wiki.greenstone.org/doku.php?id=en:user_advanced:greenstonesqlplugs&rev=1544064564#building_the_dbdmysql_package_for_mac_os_v_1013_high_sierra | first build DBD::mysql]] before returning to proceed with the rest of these instructions.\\ - If DBD::mysql 4.033 is already installed, proceed with the instructions below. 
  
  
Line 268: Line 279:
 Username ''root'' is now created for the mysql server that will run on localhost and it prints an initial password. Make note of this password. For example, if the server was initialised on Linux: Username ''root'' is now created for the mysql server that will run on localhost and it prints an initial password. Make note of this password. For example, if the server was initialised on Linux:
 <code> <code>
-  mymachine:[143]/home/me/mysql-5.7.23/bin> \ +  mymachine:[143]/home/me/mysql-5.7.23>
-    ./mysqld --datadir /home/me/mysql-5.7.23/data --lc-messages-dir /home/me/mysql-5.7.23/errmsgs --initialize+    ./bin/mysqld --datadir /home/me/mysql-5.7.23/data --lc-messages-dir /home/me/mysql-5.7.23/errmsgs --initialize
   2018-10-03T05:06:14.425489Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. \    2018-10-03T05:06:14.425489Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. \ 
     Please use --explicit_defaults_for_timestamp server option (see documentation for more details).     Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
Line 287: Line 298:
 </code> </code>
  
-3. Run the MySQL server (passing in --console is necessary on Windows to see any error messages): +3. Run the MySQL server (passing in ''--console'' is necessary on Windows to see any error messages, passing in ''--lc-messages-dir errmsgs'' is necessary for Linux): 
-<code>./mysqld --datadir /home/me/mysql-5.7.23/data [--console]</code>+<code>./bin/mysqld 
 +--datadir /home/me/mysql-5.7.23/data 
 +[--console] \ 
 +[--lc-messages-dir /home/me/mysql-5.7.23/errmsgs]</code>
  
 4. **Change root password** ([[https://stackoverflow.com/questions/16556497/how-to-reset-or-change-the-mysql-root-password | from here]]). 4. **Change root password** ([[https://stackoverflow.com/questions/16556497/how-to-reset-or-change-the-mysql-root-password | from here]]).
Line 328: Line 342:
 <code> <code>
  mymachine:[115]/home/me/mysql-5.7.23/bin> \  mymachine:[115]/home/me/mysql-5.7.23/bin> \
-   ./mysqld_safe --datadir=/home/me/mysql-5.7.23/data --character_set_server=utf8mb4+   ./mysqld_safe --datadir=/home/me/mysql-5.7.23/data 
 +   --character_set_server=utf8mb4
 </code> </code>
  
Line 360: Line 375:
  
 ===== Building the DBD::mysql package for Mac OS v 10.13 ("High Sierra") ===== ===== Building the DBD::mysql package for Mac OS v 10.13 ("High Sierra") =====
 +
 +==== Automated way ====
 +The automated way should suffice if you're on a MacOS v 10.13/High Sierra machine. The script needs internet access.
 +
 +Open a terminal and
 +
 +for GS3:
 +<code>cd /your/GS3/gs2build/perllib/cpan</code>
 +for GS2 (untested):
 +<code>cd /your/GS2/perllib/cpan</code>
 +
 +Ensure the compile-dbd-mysql.sh script has execute permissions:
 +<code>chmod u+x compile-dbd-mysql.sh</code>
 +
 +(The script has now been modified to work on Linux too, besides Mac. And it has further been updated to support compiling up DBI besides DBD. If you want DBI compiled up too, then use a text editor to open up the script compile-dbd-mysql.sh. Locate the line that says:
 +<code>NEED_PERL_DBI=false # set to true if your machine doesn't have DBI</code>
 +Change the value to true:
 +<code>NEED_PERL_DBI=true # set to true if your machine doesn't have DBI</code>
 +Save the file and close the text editor before proceeding.)
 +
 +Now run it:
 +<code>./compile-dbd-mysql.sh</code>
 +
 +The above script will:
 +1. download and install mysql v 5.7.23 inside your GSDLHOME (the GS3/gs2build folder for GS3 users)
 +2. download and compile DBD::mysql v 4.033 against the above mysql installation's libraries and header files
 +
 +Once the script has finished running
 +  * if you want, you can move the $GSDLHOME/mysql-5.7.23 into another location on your machine.
 +  * Follow the [[http://wiki.greenstone.org/doku.php?id=en:user_advanced:greenstonesqlplugs#installing_one_time_setup|MySQL installation instructions]] **from step 2 onwards** to finish setting up the MySQL server to work with Greenstone on MacOS High Sierra.\\ Once that's done, you can run the MySQL server and finally start using the Greenstone SQL Plugs in a new collection by editing its collection config file.
 +
 +
 +==== Manual way ====
 These instructions are for installing the perl package DBD::mysql version 4.033 on MacOS 10.13/High Sierra. These instructions are for installing the perl package DBD::mysql version 4.033 on MacOS 10.13/High Sierra.
 +
 +The automatic script above takes cares of all this. But if there are any issues with that, or if you want to attempt the same process of building the DBD::mysql package with different versions of either perl, DBD::mysql or mysql itself, then these steps may be useful.
  
 1. Get the DBD::mysql source package. Since on Windows we worked with DBD::mysql version 4.033, and we've now successfully built and tested that version on a High Sierra Mac using the Greenstone Plugs, we recommend the same version: 1. Get the DBD::mysql source package. Since on Windows we worked with DBD::mysql version 4.033, and we've now successfully built and tested that version on a High Sierra Mac using the Greenstone Plugs, we recommend the same version:
Line 464: Line 514:
   * Discuss table columns, column names and column types. Although users could probably see this from the table's schema once logged into the MySQL client.   * Discuss table columns, column names and column types. Although users could probably see this from the table's schema once logged into the MySQL client.
   * Have not yet tested writing out just meta or just fulltxt to sql db and reading just that back in from the sql db while the remainder is to be read back in from the docsql .xml files.   * Have not yet tested writing out just meta or just fulltxt to sql db and reading just that back in from the sql db while the remainder is to be read back in from the docsql .xml files.
-  * Test on windows and mac.+  * DONE: Tested on windows and mac.
en/user_advanced/greenstonesqlplugs.txt · Last modified: 2023/03/13 01:46 by 127.0.0.1