mirror of
https://github.com/nextcloud/server.git
synced 2026-03-02 21:41:12 -05:00
Recover installation when creating the user failed
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
bbf7ad45c3
commit
d09533cf28
1 changed files with 7 additions and 0 deletions
|
|
@ -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([
|
||||
|
|
|
|||
Loading…
Reference in a new issue