diff options
author | Joas Schilling <coding@schilljs.com> | 2020-02-05 11:08:18 +0100 |
---|---|---|
committer | Backportbot <backportbot-noreply@rullzer.com> | 2020-02-06 18:39:09 +0000 |
commit | c21b00db36c0e03b55598eb0501866356df45800 (patch) | |
tree | 496697bedd3245ad0297dc24c3cd6912b7363b0a /lib/private | |
parent | ecc4bb5666969afe5f3204656ba6ba633c4dfb4d (diff) | |
download | nextcloud-server-c21b00db36c0e03b55598eb0501866356df45800.tar.gz nextcloud-server-c21b00db36c0e03b55598eb0501866356df45800.zip |
Check the new connection on setup like with PostgreSQL and Oracle
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Setup/MySQL.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php index 4bcf6818f0e..412fa8c5a29 100644 --- a/lib/private/Setup/MySQL.php +++ b/lib/private/Setup/MySQL.php @@ -56,6 +56,16 @@ class MySQL extends AbstractDatabase { //fill the database if needed $query='select count(*) from information_schema.tables where table_schema=? AND table_name = ?'; $connection->executeQuery($query, [$this->dbName, $this->tablePrefix.'users']); + + $connection->close(); + $connection = $this->connect(); + try { + $connection->connect(); + } catch (\Exception $e) { + $this->logger->logException($e); + throw new \OC\DatabaseSetupException($this->trans->t('MySQL username and/or password not valid'), + $this->trans->t('You need to enter details of an existing account.')); + } } /** |