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

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