summaryrefslogtreecommitdiffstats
path: root/lib/private/Setup/MySQL.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Setup/MySQL.php')
-rw-r--r--lib/private/Setup/MySQL.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php
index 9998ca401d9..8290d675500 100644
--- a/lib/private/Setup/MySQL.php
+++ b/lib/private/Setup/MySQL.php
@@ -27,6 +27,7 @@
*/
namespace OC\Setup;
+use OC\DB\MySqlTools;
use OCP\IDBConnection;
class MySQL extends AbstractDatabase {
@@ -36,6 +37,13 @@ class MySQL extends AbstractDatabase {
//check if the database user has admin right
$connection = $this->connect(['dbname' => null]);
+ // detect mb4
+ $tools = new MySqlTools();
+ if ($tools->supports4ByteCharset($connection)) {
+ $this->config->setValue('mysql.utf8mb4', true);
+ $connection = $this->connect();
+ }
+
$this->createSpecificUser($username, $connection);
//create the database