diff --git a/server/core/db.js b/server/core/db.js index b729282a4..3ce2e8bfb 100644 --- a/server/core/db.js +++ b/server/core/db.js @@ -91,6 +91,13 @@ module.exports = { dbConfig.ssl = sslOptions } + // Prune host and port if socketPath is configured + if (WIKI.config.db.socketPath) { + const { host, port, ...prunedConfig} = dbConfig + dbConfig = prunedConfig + dbConfig.socketPath = WIKI.config.db.socketPath.toString() + } + // Fix mysql boolean handling... dbConfig.typeCast = (field, next) => { if (field.type === 'TINY' && field.length === 1) {