Check the new connection on setup like with PostgreSQL and Oracle
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
07e7f79a8e
commit
b48daab731
|
@ -56,6 +56,16 @@ class MySQL extends AbstractDatabase {
|
||||||
//fill the database if needed
|
//fill the database if needed
|
||||||
$query='select count(*) from information_schema.tables where table_schema=? AND table_name = ?';
|
$query='select count(*) from information_schema.tables where table_schema=? AND table_name = ?';
|
||||||
$connection->executeQuery($query, [$this->dbName, $this->tablePrefix.'users']);
|
$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.'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue