--- installer.pl.dist Tue Nov 26 09:58:08 2002 +++ installer.pl Wed Nov 27 12:06:08 2002 @@ -788,17 +788,24 @@ my $mysqldir; my $mysqluser = 'root'; my $mysqlpass = ''; +my $mysqlpass_raw = ''; foreach my $mysql (qw(/usr/local/mysql /opt/mysql /usr )) { - if ( -d $mysql ) { + if ( -d $mysql && -f "$mysql/bin/mysqladmin" ) { $mysqldir=$mysql; } } -if (!$mysqldir){ - $mysqldir='/usr'; +if (!defined $mysqldir){ + print "I don't see mysql in the usual places.\n"; + for (;;) { + print "Where have you installed mysql (value of --prefix if you compiled it yourself)? "; + chomp($mysqldir = ); + last if -f "$mysqldir/bin/mysqladmin"; + print "I can't find it there either.\n"; + } } print qq| To allow us to create the koha database please supply the @@ -809,7 +816,10 @@ while ($needpassword) { print "Enter mysql\'s root users password: "; chomp($input = ); - $mysqlpass = $input; + $mysqlpass_raw = $input; + $mysqlpass = $mysqlpass_raw; + $mysqlpass =~ s/"/\\"/g; + $mysqlpass = "\"$mysqlpass\""; my $result=system("$mysqldir/bin/mysqladmin -u$mysqluser -p$mysqlpass proc > /dev/null 2>&1"); if ($result) { print "\n\nInvalid password for the MySql root user.\n\n";