version 1.2, 2003/07/22 19:24:35
|
version 1.3, 2003/08/22 22:30:50
|
Line 32 my $runstatus = shift();
|
Line 32 my $runstatus = shift();
|
if (! defined($runstatus)) { |
if (! defined($runstatus)) { |
$runstatus = 'firstrun'; |
$runstatus = 'firstrun'; |
} |
} |
|
my $rhver=`perl ../build/distprobe`; |
my $rpmname = "perl-DBD-MySQL-1.2216-4.i386.rpm"; |
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'); |
my $perlvar = &LONCAPA::Configuration::read_conf('loncapa.conf'); |
delete($perlvar->{'lonReceipt'}); # remove since sensitive and not needed |
delete($perlvar->{'lonReceipt'}); # remove since sensitive and not needed |
Line 79 END
|
Line 84 END
|
chomp $rootpass; |
chomp $rootpass; |
print("\n"); |
print("\n"); |
|
|
|
my $extraargs; |
|
if ($rhver eq 'redhat9') { $extraargs=",'Y','Y'"; } |
print("Starting mysql client and setting up permissions\n"); |
print("Starting mysql client and setting up permissions\n"); |
open MYSQL, "|mysql -u root mysql" || die "Unable to start mysql\n"; |
open MYSQL, "|mysql -u root mysql" || die "Unable to start mysql\n"; |
print MYSQL <<"ENDMYSQLPERMISSIONINIT"; |
print MYSQL <<"ENDMYSQLPERMISSIONINIT"; |
Line 87 USE mysql;
|
Line 94 USE mysql;
|
INSERT IGNORE INTO user (Host, User, Password) |
INSERT IGNORE INTO user (Host, User, Password) |
VALUES ('localhost','www',password('localhostkey')); |
VALUES ('localhost','www',password('localhostkey')); |
INSERT IGNORE INTO db VALUES ('localhost','loncapa','www', |
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'); |
SET PASSWORD FOR root\@localhost=PASSWORD('$rootpass'); |
DELETE FROM user WHERE host<>'localhost'; |
DELETE FROM user WHERE host<>'localhost'; |
FLUSH PRIVILEGES; |
FLUSH PRIVILEGES; |
Line 101 if (defined($dbi_is_present)) {
|
Line 108 if (defined($dbi_is_present)) {
|
print "Your system is misconfigured. ". |
print "Your system is misconfigured. ". |
"You are missing the perl DBI package\n"; |
"You are missing the perl DBI package\n"; |
exit 1; |
exit 1; |
|
} else { |
|
use DBI; |
} |
} |
|
|
my $dbh; |
my $dbh; |