From 2785bbd29bcc1b39d9abe90724333dd42af34b10 Mon Sep 17 00:00:00 2001 From: Pascal Paulis Date: Mon, 5 Feb 2024 10:36:31 +0100 Subject: [PATCH] added comment about MySQL Server parameter sql_generate_invisible_primary_key Closes #23268 Signed-off-by: Pascal Paulis --- docs/guides/server/db.adoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/guides/server/db.adoc b/docs/guides/server/db.adoc index d2d4c8c6bd..caa6ce8ba8 100644 --- a/docs/guides/server/db.adoc +++ b/docs/guides/server/db.adoc @@ -227,6 +227,12 @@ show server_encoding; create database keycloak with encoding 'UTF8'; ---- +== Configuring MySQL server + +Beginning with MySQL 8.0.30, MySQL supports generated invisible primary keys for any InnoDB table that is created without an explicit primary key (more information https://dev.mysql.com/doc/refman/8.0/en/create-table-gipks.html[here]). +If this feature is enabled, the database schema initialization and also migrations will fail with the error message `Multiple primary key defined (1068)`. +You then need to disable it by setting the parameter `sql_generate_invisible_primary_key` to `OFF` in your MySQL server configuration before installing or upgrading Keycloak. + == Changing database locking timeout in a cluster configuration Because cluster nodes can boot concurrently, they take extra time for database actions. For example, a booting server instance may perform some database migration, importing, or first time initializations. A database lock prevents start actions from conflicting with each other when cluster nodes boot up concurrently.