summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorBjörn Schießle <bjoern@schiessle.org>2016-07-27 14:34:07 +0200
committerGitHub <noreply@github.com>2016-07-27 14:34:07 +0200
commit10726dd00df37be77c3088302e16e64b09a6d25f (patch)
treebc0aea7b1def33b2ef141965ff6a77451a7e0cc0 /lib/private
parentb8a088fabfa00af4e028a7644078d0b81c842755 (diff)
parentaeb40112794c8c4c9e9862986ed51792cfd7253c (diff)
downloadnextcloud-server-10726dd00df37be77c3088302e16e64b09a6d25f.tar.gz
nextcloud-server-10726dd00df37be77c3088302e16e64b09a6d25f.zip
Merge pull request #596 from nextcloud/adjust-mysql-install-error
Fix misleading MySQL DB creation error (#25485)
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Setup/MySQL.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php
index 817a6060608..4ad6926c2d7 100644
--- a/lib/private/Setup/MySQL.php
+++ b/lib/private/Setup/MySQL.php
@@ -61,12 +61,20 @@ class MySQL extends AbstractDatabase {
//we can't use OC_BD functions here because we need to connect as the administrative user.
$query = "CREATE DATABASE IF NOT EXISTS `$name` CHARACTER SET utf8 COLLATE utf8_bin;";
$connection->executeUpdate($query);
+ } catch (\Exception $ex) {
+ $this->logger->error('Database creation failed: {error}', [
+ 'app' => 'mysql.setup',
+ 'error' => $ex->getMessage()
+ ]);
+ return;
+ }
+ try {
//this query will fail if there aren't the right permissions, ignore the error
$query="GRANT ALL PRIVILEGES ON `$name` . * TO '$user'";
$connection->executeUpdate($query);
} catch (\Exception $ex) {
- $this->logger->error('Database creation failed: {error}', [
+ $this->logger->debug('Could not automatically grant privileges, this can be ignored if database user already had privileges: {error}', [
'app' => 'mysql.setup',
'error' => $ex->getMessage()
]);