summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-08-12 09:43:38 +0200
committerJoas Schilling <coding@schilljs.com>2022-08-12 11:21:27 +0200
commitd09533cf2888ccd8b995add8012ef32d92efbca4 (patch)
treeba70f49bd6336ec2c1ef1632d0fe21d5e9228d5f /lib/private
parentbbf7ad45c3f78f087491f028c66bc1ee6d49648b (diff)
downloadnextcloud-server-d09533cf2888ccd8b995add8012ef32d92efbca4.tar.gz
nextcloud-server-d09533cf2888ccd8b995add8012ef32d92efbca4.zip
Recover installation when creating the user failed
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Setup/MySQL.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php
index 920baf3e4ee..491419dfaf6 100644
--- a/lib/private/Setup/MySQL.php
+++ b/lib/private/Setup/MySQL.php
@@ -129,6 +129,7 @@ class MySQL extends AbstractDatabase {
'exception' => $ex,
'app' => 'mysql.setup',
]);
+ throw $ex;
}
}
@@ -138,6 +139,9 @@ class MySQL extends AbstractDatabase {
* @return array
*/
private function createSpecificUser($username, $connection) {
+ $rootUser = $this->dbUser;
+ $rootPassword = $this->dbPassword;
+
try {
//user already specified in config
$oldUser = $this->config->getValue('dbuser', false);
@@ -180,6 +184,9 @@ class MySQL extends AbstractDatabase {
'exception' => $ex,
'app' => 'mysql.setup',
]);
+ // Restore the original credentials
+ $this->dbUser = $rootUser;
+ $this->dbPassword = $rootPassword;
}
$this->config->setValues([