mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Recover installation when creating the user failed
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
7391c81495
commit
d275c93035
1 changed files with 7 additions and 0 deletions
|
|
@ -129,6 +129,7 @@ class MySQL extends AbstractDatabase {
|
|||
'exception' => $ex,
|
||||
'app' => 'mysql.setup',
|
||||
]);
|
||||
throw $ex;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -137,6 +138,9 @@ class MySQL extends AbstractDatabase {
|
|||
* @param IDBConnection $connection
|
||||
*/
|
||||
private function createSpecificUser($username, $connection): void {
|
||||
$rootUser = $this->dbUser;
|
||||
$rootPassword = $this->dbPassword;
|
||||
|
||||
try {
|
||||
//user already specified in config
|
||||
$oldUser = $this->config->getValue('dbuser', false);
|
||||
|
|
@ -179,6 +183,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