diff --git a/server/config/default.yaml b/server/config/default.yaml index e23cc9c0..63769b29 100644 --- a/server/config/default.yaml +++ b/server/config/default.yaml @@ -124,11 +124,9 @@ mysql: # Some installations, eg. MAMP can use a different port (8889) # MAMP users should also turn on Allow network access to MySQL otherwise MySQL might not be accessible port: 3306 - charset: utf8mb4 # The timezone configured on the MySQL server. This can be 'local', 'Z', or an offset in the form +HH:MM or -HH:MM # If the MySQL server runs on the same server as Mailtrain, use 'local' timezone: local - multipleStatements: true verp: # Enable to start an MX server that detects bounced messages using VERP diff --git a/server/lib/knex.js b/server/lib/knex.js index 43cc7194..73d1b0ee 100644 --- a/server/lib/knex.js +++ b/server/lib/knex.js @@ -10,7 +10,10 @@ const knex = require('knex')({ connection: { ...config.mysql, - // DATE and DATETIME types contain no timezone info. The MySQL driver tries to interpret them w.r.t. to local time, which + charset: utf8mb4, + multipleStatements: true, + + // DATE and DATETIME types contain no timezone info. The MySQL driver tries to interpret them w.r.t. to local time, which // does not work well with assigning these values in UTC and handling them as if in UTC dateStrings: [ 'DATE', diff --git a/server/setup/knex/knexfile.js b/server/setup/knex/knexfile.js index ecb9416e..82622aea 100644 --- a/server/setup/knex/knexfile.js +++ b/server/setup/knex/knexfile.js @@ -1,6 +1,10 @@ 'use strict'; -const config = require('./config'); +let config = require('./config'); + +config.mysql.charset="utf8mb4"; +config.mysql.multipleStatements=true; + module.exports = { client: 'mysql', diff --git a/setup/functions b/setup/functions index db9e51ff..66cd8cc2 100644 --- a/setup/functions +++ b/setup/functions @@ -233,8 +233,6 @@ www: mysql: password: "$mysqlPassword" - charset: utf8mb4 - multipleStatements: true redis: enabled: true