]> source.dussan.org Git - nextcloud-server.git/commitdiff
Check the new connection on setup like with PostgreSQL and Oracle
authorJoas Schilling <coding@schilljs.com>
Wed, 5 Feb 2020 10:08:18 +0000 (11:08 +0100)
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Tue, 14 Apr 2020 09:02:14 +0000 (11:02 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/Setup/MySQL.php

index 964f16f3711dc8e4db2c8a171eea76153c8e51bf..c125619f6d3c03c098f7d882d88b169b71acb7b3 100644 (file)
@@ -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.'));
+               }
        }
 
        /**