From efa881d016a55b27f89ac39a5d9b4cbdb67dd740 Mon Sep 17 00:00:00 2001 From: Hisanobu Okuda Date: Fri, 28 Nov 2025 19:03:11 +0900 Subject: [PATCH] Add MariaDB to MySQL description and specify SQL to support UTF-8 Closes #44548 Signed-off-by: Hisanobu Okuda Signed-off-by: Alexander Schwartz Co-authored-by: Alexander Schwartz --- docs/guides/server/db.adoc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/guides/server/db.adoc b/docs/guides/server/db.adoc index 1b88f8ee31f..75f12379427 100644 --- a/docs/guides/server/db.adoc +++ b/docs/guides/server/db.adoc @@ -236,13 +236,18 @@ Unicode characters are supported only for the special fields for a Microsoft SQL The `sendStringParametersAsUnicode` property of JDBC driver should be set to `false` to significantly improve performance. Without this parameter, the Microsoft SQL Server might be unable to use indexes. -=== Configuring Unicode support for a MySQL database +=== Configuring Unicode support for a MySQL/MariaDB database -Unicode characters are supported in a MySQL database if the database was created with Unicode support in the VARCHAR and CHAR fields when using the CREATE DATABASE command. +Unicode characters are supported in a MySQL/MariaDB database if the database was created with Unicode support in the VARCHAR and CHAR fields when using the following SQL statement. + +[source,sql] +---- +create database keycloak character set utf8mb3; +---- Note that the utf8mb4 character set is not supported due to different storage requirements for the utf8 character set. See MySQL documentation for details. In that situation, the length restriction on non-special fields does not apply because columns are created to accommodate the number of characters, not bytes. If the database default character set does not allow Unicode storage, only the special fields allow storing Unicode values. -. Start MySQL Server. +. Start MySQL/MariaDB Server. . Under JDBC driver settings, locate the *JDBC connection settings*. . Add this connection property: `characterEncoding=UTF-8`