]> source.dussan.org Git - nextcloud-server.git/commitdiff
Recover installation when creating the user failed
authorJoas Schilling <coding@schilljs.com>
Fri, 12 Aug 2022 07:43:38 +0000 (09:43 +0200)
committerJoas Schilling <coding@schilljs.com>
Fri, 12 Aug 2022 09:21:27 +0000 (11:21 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/Setup/MySQL.php

index 920baf3e4ee1021094160fe53e045f6521ed92ed..491419dfaf6b6fa0f4555f1ff6278049080c2418 100644 (file)
@@ -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([