Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Recover installation when creating the user failed
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Aug 12, 2022
commit d275c930356fd4203c0cf9e2850c8e92f3d0c2b9
7 changes: 7 additions & 0 deletions lib/private/Setup/MySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ private function createDBUser($connection) {
'exception' => $ex,
'app' => 'mysql.setup',
]);
throw $ex;
}
}

Expand All @@ -137,6 +138,9 @@ private function createDBUser($connection) {
* @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);
Expand Down Expand Up @@ -179,6 +183,9 @@ private function createSpecificUser($username, $connection): void {
'exception' => $ex,
'app' => 'mysql.setup',
]);
// Restore the original credentials
$this->dbUser = $rootUser;
$this->dbPassword = $rootPassword;
}

$this->config->setValues([
Expand Down