--- doc/build/Attic/loncapasqldatabase.html 2001/02/14 15:20:55 1.9 +++ doc/build/Attic/loncapasqldatabase.html 2001/02/16 12:40:29 1.12 @@ -8,7 +8,7 @@ Scott Harrison

-Last updated: 02/14/2001 +Last updated: 02/15/2001

This file describes issues associated with LON-CAPA @@ -32,6 +32,43 @@ and a SQL database.

Important notes

+The current database is implemented assuming a non-adjustable +architecture involving these data fields (specific to each version +of a resource). +

+

+

+These commands create the loncapameta database. +

+mysql> CREATE DATABASE IF NOT EXISTS loncapameta
+    -> CREATE TABLE IF NOT EXISTS resourceversions
+
+
+

+

+An important quote from the manual: +

+In MySQL Version 3.23.23 or later, you can also create special FULLTEXT indexes. They are used for full-text search. Only the MyISAM table type supports FULLTEXT indexes. They can be created only from +VARCHAR and TEXT columns. Indexing always happens over the entire column and partial indexing is not supported. See section 25.2 MySQL Full-text Search for details. +
+

+

+I plan on using a MyISAM table type with 11 metadata fields of column +type=TEXT. +

+

It might be worthwhile to look at /usr/local/mysql/manual.html. It is quite in depth.

@@ -224,6 +261,51 @@ that is subsequently compiled). wind up in /usr/local/mysql-3.23.33-pc-linux-gnu-i686 except for a link from /usr/local/mysql to /usr/local/mysql-3.23.33-pc-linux-gnu-i686 and some files involved in system process handling (/etc/rc.d/*/*mysql). +
+(As user=root)
+cd /usr/local/;
+tar xzvf mysql-3.23.33-pc-linux-gnu-i686.tar.gz
+ln -s /usr/local/mysql-3.23.33-pc-linux-gnu-i686 mysql
+cd /usr/local/mysql
+chown -R www /usr/local/mysql/.
+chgrp -R users /usr/local/mysql/.
+chmod -R g-w,g-r,g-x /usr/local/mysql/.
+(probably also want chmod -R a-w,a-r,a-x /usr/local/mysql/.)
+
+Alter safe_mysqld
+and support-files/mysql.server to use 'localhosts' instead
+of `bin/hostname`.  Also, to use user 'www' instead of 'mysql'.
+
+(These changes could be done with /etc/my.cnf, but
+I think this approach makes sure the database NEVER
+gets screwed up due to somebody forgetting to install /etc/my.cnf).
+
+Change this line in mysql.server from
+  pid_file=$datadir/`@HOSTNAME@`.pid
+to
+  pid_file=$datadir/localhost.pid
+
+Change this line in safe_mysqld from
+user=root
+to
+user=www
+
+Change this line in safe_mysqld from
+  pid_file=$DATADIR/`/bin/hostname`.pid
+to
+  pid_file=$DATADIR/localhost.pid
+
+Change this line in safe_mysqld from
+test -z "$err_log"  && err_log=$DATADIR/`/bin/hostname`.err
+to
+test -z "$err_log"  && err_log=$DATADIR/localhost.err
+
+cp -p support-files/mysql.server /etc/rc.d/init.d/mysql
+chmod 755 /etc/rc.d/init.d/mysql
+/sbin/chkconfig --add mysql
+/etc/rc.d/init.d/mysql start
+
+

This is how I installed the Msql-Mysql-modules perl modules.

@@ -243,6 +325,13 @@ Enter the appropriate number:  [3] 1
 Do you want to install the MysqlPerl emulation? You might keep your old
 Mysql module (to be distinguished from DBD::mysql!) if you are concerned
 about compatibility to existing applications! [y] n
+Where is your MySQL installed? Please tell me the directory that
+contains the subdir 'include'. [/usr/local/mysql] 
+Which database should I use for testing the MySQL drivers? [test] 
+On which host is database test running (hostname, ip address
+or host:port) [localhost] 
+User name for connecting to database test? [undef]
+Password for connecting to database test? [undef]
 [root@fenchurch Msql-Mysql-modules-1.2215]# make
 [root@fenchurch Msql-Mysql-modules-1.2215]# make test
 make[1]: Entering directory `/home/user/Msql-Mysql-modules-1.2215/mysql'
@@ -326,7 +415,7 @@ All tests successful, 1 test skipped.
 Files=7,  Tests=179,  7 wallclock secs ( 6.46 cusr +  0.49 csys =  6.95 CPU)
 PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/perl5/5.00503/i386-linux -I/usr/lib/perl5/5.00503 test.pl
 test.pl 
-DBI test application $Revision: 1.9 $
+DBI test application $Revision: 1.12 $
 Using /home/user/DBI-1.14/blib
 Switch: DBI 1.14 by Tim Bunce, 1.14
 Available Drivers: ADO, ExampleP, Multiplex, Proxy, mysql
@@ -517,6 +606,21 @@ An up-to-date lond and lonsql.
 

Testing

+To test the backend MySQL database, a number of commands should be +run after installation. +

+

+These are sections of perl code which helps test the LON-CAPA network.

 ** TEST the database connection with my current tester.pl code
 which mimics what command will eventually be sent through lonc.