diff --git a/packages/nocodb/src/lib/db/sql-client/lib/mysql/mysql.queries.ts b/packages/nocodb/src/lib/db/sql-client/lib/mysql/mysql.queries.ts index 0c6015ae50..c2ce9c2346 100644 --- a/packages/nocodb/src/lib/db/sql-client/lib/mysql/mysql.queries.ts +++ b/packages/nocodb/src/lib/db/sql-client/lib/mysql/mysql.queries.ts @@ -130,7 +130,7 @@ AND t.table_name=?;`, }, createDatabaseIfNotExists: { default: { - sql: `create database if not exists ??`, + sql: `create database if not exists ?? CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci`, paramsHints: ['database'], }, }, diff --git a/packages/nocodb/src/lib/db/sql-client/lib/pg/PgClient.ts b/packages/nocodb/src/lib/db/sql-client/lib/pg/PgClient.ts index e51f49d78f..20349fcac2 100644 --- a/packages/nocodb/src/lib/db/sql-client/lib/pg/PgClient.ts +++ b/packages/nocodb/src/lib/db/sql-client/lib/pg/PgClient.ts @@ -468,7 +468,7 @@ class PGClient extends KnexClient { } if (rows.length === 0) { log.debug('creating database:', args); - await tempSqlClient.raw(`CREATE DATABASE ??`, [args.database]); + await tempSqlClient.raw(`CREATE DATABASE ?? ENCODING 'UTF8'`, [args.database]); } // if (this.connectionConfig.searchPath && this.connectionConfig.searchPath[0]) {