summaryrefslogtreecommitdiffstats
path: root/checksetup.pl
diff options
context:
space:
mode:
authordave%intrec.com <>2000-08-23 03:30:05 +0200
committerdave%intrec.com <>2000-08-23 03:30:05 +0200
commit24ba85e278db6a0d7029af8a0408485ce33553d6 (patch)
treefa1f9c0f5c9670b4911c7ca0db39b24413d4bc78 /checksetup.pl
parentff85006b3da36c24439c87f016aafe3317347ef0 (diff)
downloadbugzilla-24ba85e278db6a0d7029af8a0408485ce33553d6.tar.gz
bugzilla-24ba85e278db6a0d7029af8a0408485ce33553d6.tar.xz
Fix for bug 16454: can now run checksetup.pl on databases with passwords.
Diffstat (limited to 'checksetup.pl')
-rwxr-xr-xchecksetup.pl9
1 files changed, 6 insertions, 3 deletions
diff --git a/checksetup.pl b/checksetup.pl
index fa575b1c2..f3371b977 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -502,10 +502,12 @@ my $drh = DBI->install_driver($db_base)
if ($db_check) {
# Do we have the database itself?
- my @databases = $drh->func($db_host, $db_port, '_ListDBs');
+ my $dsn = "DBI:$db_base:$db_name;$db_host;$db_port";
+ my $dbh = DBI->connect($dsn, $db_user, $db_pass);
+ my @databases = $dbh->func('_ListDBs');
unless (grep /^$db_name$/, @databases) {
- print "Creating database $db_name ...\n";
- $drh->func('createdb', $db_name, 'admin')
+ print "Creating database $db_name ...\n";
+ $drh->func('createdb', $db_name, "$db_host:$db_port", $db_user, $db_pass, 'admin')
or die <<"EOF"
The '$db_name' database is not accessible. This might have several reasons:
@@ -518,6 +520,7 @@ The '$db_name' database is not accessible. This might have several reasons:
'\$db_check' to zero.\n
EOF
}
+ $dbh->disconnect if $dbh;
}
# now get a handle to the database: