From edf806b98d675a2037b019644aff76b7e8b7738c Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 21 Nov 2011 02:33:09 -0500
Subject: [PATCH] Merged revisions 2741-2788 from SVN stable branch.
---
install/update.php | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/install/update.php b/install/update.php
index 74764ce..769cdce 100644
--- a/install/update.php
+++ b/install/update.php
@@ -139,11 +139,17 @@
$clientdb_user = '';
$clientdb_password = '';
-//** Ask user for mysql admin_password if empty
-if( empty($conf["mysql"]["admin_password"]) ) {
-
- $conf["mysql"]["admin_password"] = $inst->free_query('MySQL root password', $conf['mysql']['admin_password']);
-}
+//** Test mysql root connection
+$finished = false;
+do {
+ if(@mysql_connect($conf["mysql"]["host"],$conf["mysql"]["admin_user"],$conf["mysql"]["admin_password"])) {
+ $finished = true;
+ } else {
+ swriteln($inst->lng('Unable to connect to mysql server').' '.mysql_error());
+ $conf["mysql"]["admin_password"] = $inst->free_query('MySQL root password', $conf['mysql']['admin_password']);
+ }
+} while ($finished == false);
+unset($finished);
/*
* Prepare the dump of the database
@@ -152,7 +158,6 @@
//* initialize the database
$inst->db = new db();
-$inst->db->dbName = $conf["mysql"]["database"];
//* initialize the master DB, if we have a multiserver setup
if($conf['mysql']['master_slave_setup'] == 'y') {
--
Gitblit v1.9.1