diff options
author | Joas Schilling <coding@schilljs.com> | 2020-02-05 13:08:18 +0300 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-04-14 12:02:14 +0300 |
commit | b48daab7311065acb9f49e8544628d23535641c6 (patch) | |
tree | d7a709187f9020a885fca13fcc4ae9ca3e1f2a3d | |
parent | 07e7f79a8e15a1ed33836c3866839e81963b4c73 (diff) |
Check the new connection on setup like with PostgreSQL and Oracle
Signed-off-by: Joas Schilling <coding@schilljs.com>
-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 964f16f3711..c125619f6d3 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.')); + } } /** |