summaryrefslogtreecommitdiffstats
path: root/checksetup.pl
diff options
context:
space:
mode:
authorjocuri%softhome.net <>2004-10-20 05:33:27 +0200
committerjocuri%softhome.net <>2004-10-20 05:33:27 +0200
commitb8cd8386a625ffaa21af579e78aaa5f1aa2cbcd8 (patch)
treee4c497182f12c34019f10701ac8232613bbf9047 /checksetup.pl
parent7db6b82d113bb5a647255fce7075ffa7e794940e (diff)
downloadbugzilla-b8cd8386a625ffaa21af579e78aaa5f1aa2cbcd8.tar.gz
bugzilla-b8cd8386a625ffaa21af579e78aaa5f1aa2cbcd8.tar.xz
Patch for bug 264003: Include the DBI error in the error message if 'createdb' fails; patch by Byron Jones (glob) <bugzilla@glob.com.au>; r=kiko, a=justdave.
Diffstat (limited to 'checksetup.pl')
-rwxr-xr-xchecksetup.pl12
1 files changed, 9 insertions, 3 deletions
diff --git a/checksetup.pl b/checksetup.pl
index 0a5bb6109..e5431b8a5 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -1455,10 +1455,15 @@ if ($my_db_check) {
my @databases = $dbh->func('_ListDBs');
unless (grep /^$my_db_name$/, @databases) {
print "Creating database $my_db_name ...\n";
- $dbh->func('createdb', $my_db_name, 'admin')
- or die <<"EOF"
+ if (!$dbh->func('createdb', $my_db_name, 'admin')) {
+ my $error = $dbh->errstr;
+ die <<"EOF"
-The '$my_db_name' database is not accessible. This might have several reasons:
+The '$my_db_name' database could not be created. The error returned was:
+
+$error
+
+This might have several reasons:
* MySQL is not running.
* MySQL is running, but the rights are not set correct. Go and read the
@@ -1468,6 +1473,7 @@ The '$my_db_name' database is not accessible. This might have several reasons:
sure all settings in '$localconfig' are correct. If all else fails, set
'\$db_check' to zero.\n
EOF
+ }
}
$dbh->disconnect if $dbh;
}