--- loncom/metadata_database/configure_mysql_db.pl 2003/07/22 19:24:35 1.2 +++ loncom/metadata_database/configure_mysql_db.pl 2003/08/22 22:30:50 1.3 @@ -2,7 +2,7 @@ # The LearningOnline Network # Red Hat 7.3 installation script # -# $Id: configure_mysql_db.pl,v 1.2 2003/07/22 19:24:35 matthew Exp $ +# $Id: configure_mysql_db.pl,v 1.3 2003/08/22 22:30:50 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,8 +32,13 @@ my $runstatus = shift(); if (! defined($runstatus)) { $runstatus = 'firstrun'; } - -my $rpmname = "perl-DBD-MySQL-1.2216-4.i386.rpm"; +my $rhver=`perl ../build/distprobe`; +my $rpmname; +if ($rhver eq 'redhat9') { + $rpmname = "perl-DBD-MySQL-2.9002-1.i386.rpm"; +} else { + $rpmname = "perl-DBD-MySQL-1.2216-4.i386.rpm"; +} my $perlvar = &LONCAPA::Configuration::read_conf('loncapa.conf'); delete($perlvar->{'lonReceipt'}); # remove since sensitive and not needed @@ -79,6 +84,8 @@ END chomp $rootpass; print("\n"); + my $extraargs; + if ($rhver eq 'redhat9') { $extraargs=",'Y','Y'"; } print("Starting mysql client and setting up permissions\n"); open MYSQL, "|mysql -u root mysql" || die "Unable to start mysql\n"; print MYSQL <<"ENDMYSQLPERMISSIONINIT"; @@ -87,7 +94,7 @@ USE mysql; INSERT IGNORE INTO user (Host, User, Password) VALUES ('localhost','www',password('localhostkey')); INSERT IGNORE INTO db VALUES ('localhost','loncapa','www', - 'Y','Y','Y','Y','Y','Y','N','Y','Y','Y'); + 'Y','Y','Y','Y','Y','Y','N','Y','Y','Y'$extraargs); SET PASSWORD FOR root\@localhost=PASSWORD('$rootpass'); DELETE FROM user WHERE host<>'localhost'; FLUSH PRIVILEGES; @@ -101,6 +108,8 @@ if (defined($dbi_is_present)) { print "Your system is misconfigured. ". "You are missing the perl DBI package\n"; exit 1; +} else { + use DBI; } my $dbh;