# \#database

**URL:** https://forum.keycloak.org/tag/database/67.md

[Latest](https://forum.keycloak.org/latest.md) · [Categories](https://forum.keycloak.org/categories.md) · [Tags](https://forum.keycloak.org/tags.md)

---

## [Keycloak 26.6.0 - moving from utf8mb3 to utf8mb4 on MariaDB](https://forum.keycloak.org/t/keycloak-26-6-0-moving-from-utf8mb3-to-utf8mb4-on-mariadb/31378)

<div class="topic-metadata">

**Author:** [@TwizzyDizzy](https://forum.keycloak.org/u/TwizzyDizzy)\
**Replies:** 1\
**Last updated:** [June 30, 2026, 12:44pm UTC](https://forum.keycloak.org/t/keycloak-26-6-0-moving-from-utf8mb3-to-utf8mb4-on-mariadb/31378 "2026-06-30T12:44:00Z")

</div>

Hi folks, first-timer here :waving\_hand: (that’s why I have to put some links as code block, as I cannot have more than two links in my first post). In the “notable changes” section of the upgrade guide for Keycloak 26…

---

## [Upgrade mysql java connector from ver8.3.x to latest ver9.x](https://forum.keycloak.org/t/upgrade-mysql-java-connector-from-ver8-3-x-to-latest-ver9-x/31290)

<div class="topic-metadata">

**Author:** [@zoidvs](https://forum.keycloak.org/u/zoidvs)\
**Replies:** 1\
**Last updated:** [March 6, 2026, 8:46pm UTC](https://forum.keycloak.org/t/upgrade-mysql-java-connector-from-ver8-3-x-to-latest-ver9-x/31290 "2026-03-06T20:46:36Z")

</div>

All - As noted in the MySQL release notes (https://dev.mysql.com/doc/relnotes/connector-j/en/news-8-3-0.html), version 8.3.x was released in 2024. Since then, MySQL Connector/J has advanced substantially and is now at ve…

---

## [I upgraded to version 26.2.0 from version 23.0.0, how can I migrate Database](https://forum.keycloak.org/t/i-upgraded-to-version-26-2-0-from-version-23-0-0-how-can-i-migrate-database/29980)

<div class="topic-metadata">

**Author:** [@ayush9527](https://forum.keycloak.org/u/ayush9527)\
**Replies:** 0\
**Last updated:** [May 8, 2025, 7:39am UTC](https://forum.keycloak.org/t/i-upgraded-to-version-26-2-0-from-version-23-0-0-how-can-i-migrate-database/29980 "2025-05-08T07:39:39Z")

</div>

Hi Guys, I am new to keycloak and need help to migrate database for version 26.2.0 from 23.0.0. I have take a new fork from Keycloak Github and do my old changes there mostly in themes folder then build the project usi…

---

## [Problems with database connection](https://forum.keycloak.org/t/problems-with-database-connection/29600)

<div class="topic-metadata">

**Author:** [@alansatis](https://forum.keycloak.org/u/alansatis)\
**Replies:** 1\
**Last updated:** [February 28, 2025, 4:21am UTC](https://forum.keycloak.org/t/problems-with-database-connection/29600 "2025-02-28T04:21:52Z")

</div>

Hello everyone, I would like some help. I’m trying to configure Keycloak version 26.1.0 to connect to a database in Azure. Postgres Flex. However, I’m having some errors in the certificate chain. I’ve already made all t…

---

## [KeyCloak Backend from MySQL to MSSQL](https://forum.keycloak.org/t/keycloak-backend-from-mysql-to-mssql/24408)

<div class="topic-metadata">

**Author:** [@arunghanta](https://forum.keycloak.org/u/arunghanta)\
**Replies:** 4\
**Last updated:** [November 18, 2024, 8:09pm UTC](https://forum.keycloak.org/t/keycloak-backend-from-mysql-to-mssql/24408 "2024-11-18T20:09:44Z")

</div>

KeyCloak Backend from MySQL to MSSQL We’re using KeyCloak 21.x (Qurakus) with MySQL as it’s backend. Requirement from our Operations Team is to migrating it to MSSQL. Can this be achieved? Looking for some help and in…

---

## [Read Replica Database with Keycloak](https://forum.keycloak.org/t/read-replica-database-with-keycloak/28645)

<div class="topic-metadata">

**Author:** [@jarbaspsf](https://forum.keycloak.org/u/jarbaspsf)\
**Replies:** 0\
**Last updated:** [November 7, 2024, 6:16pm UTC](https://forum.keycloak.org/t/read-replica-database-with-keycloak/28645 "2024-11-07T18:16:59Z")

</div>

Hello everyone, We have a Keycloak instance deployed with Aurora RDS. Currently, it seems that adding a read replica may not be beneficial for offloading traffic from our primary (write) database, as it appears that mos…

---

## [KeyCloak database, Is there control field?](https://forum.keycloak.org/t/keycloak-database-is-there-control-field/28323)

<div class="topic-metadata">

**Author:** [@Abeldlfa1](https://forum.keycloak.org/u/Abeldlfa1)\
**Replies:** 0\
**Last updated:** [October 15, 2024, 12:17am UTC](https://forum.keycloak.org/t/keycloak-database-is-there-control-field/28323 "2024-10-15T00:17:01Z")

</div>

Hi dears. I am currently trying to identify if there is any table that could provide me details of the date of the inserts in the user\_required\_action table. I see that this table contains only user\_id and required\_act…

---

## [Oracle DB user privileges](https://forum.keycloak.org/t/oracle-db-user-privileges/18699)

<div class="topic-metadata">

**Author:** [@morgoth\_16zh](https://forum.keycloak.org/u/morgoth_16zh)\
**Replies:** 7\
**Last updated:** [October 14, 2024, 10:30am UTC](https://forum.keycloak.org/t/oracle-db-user-privileges/18699 "2024-10-14T10:30:05Z")

</div>

I can setup keycloak with oracle database when i give the database user all privileges GRANT ALL PRIVILEGES to user But I want to restrict it. Does anyone has an idea wich minimal privileges a oracle user must have to …

---

## [Locating realm role's associated attributes in postgres](https://forum.keycloak.org/t/locating-realm-roles-associated-attributes-in-postgres/28279)

<div class="topic-metadata">

**Author:** [@nitinramvelraj](https://forum.keycloak.org/u/nitinramvelraj)\
**Replies:** 6\
**Last updated:** [October 12, 2024, 6:14am UTC](https://forum.keycloak.org/t/locating-realm-roles-associated-attributes-in-postgres/28279 "2024-10-12T06:14:58Z")

</div>

I can see that the realm roles are under a table called keycloak\_role. In the UI I have the associated roles through which I can assign a client role to the realm role. I want to see this in the postgres database. Which …

---

## [Upgrade from 25.0.1 to 26.0.0 failure](https://forum.keycloak.org/t/upgrade-from-25-0-1-to-26-0-0-failure/28205)

<div class="topic-metadata">

**Author:** [@mixman68](https://forum.keycloak.org/u/mixman68)\
**Replies:** 0\
**Last updated:** [October 5, 2024, 12:55pm UTC](https://forum.keycloak.org/t/upgrade-from-25-0-1-to-26-0-0-failure/28205 "2024-10-05T12:55:07Z")

</div>

Hello, I tried to upgrade a non complex installation from 25.0.1 to 26.0.0 and I got this error when a user try to login to SSO 2024-10-05 12:49:19,334 INFO \[org.hibernate.event.internal.DefaultLoadEventListener\] (org.…

---

## [Soft Delete Option in Keycloak User Federation](https://forum.keycloak.org/t/soft-delete-option-in-keycloak-user-federation/27520)

<div class="topic-metadata">

**Author:** [@sunny](https://forum.keycloak.org/u/sunny)\
**Replies:** 3\
**Last updated:** [August 26, 2024, 6:45am UTC](https://forum.keycloak.org/t/soft-delete-option-in-keycloak-user-federation/27520 "2024-08-26T06:45:25Z")

</div>

I’m using Keycloak (25.0.1) with AD integration via user federation. When a user is removed from an AD group, their entry in Keycloak’s user\_entity table is deleted, along with all references. Is there a way to implemen…

---

## [Is it possible to set data encryption in DB in Keycloak settings](https://forum.keycloak.org/t/is-it-possible-to-set-data-encryption-in-db-in-keycloak-settings/1241)

<div class="topic-metadata">

**Author:** [@onswebdev](https://forum.keycloak.org/u/onswebdev)\
**Replies:** 11\
**Last updated:** [July 12, 2024, 4:51am UTC](https://forum.keycloak.org/t/is-it-possible-to-set-data-encryption-in-db-in-keycloak-settings/1241 "2024-07-12T04:51:17Z")

</div>

Due to some GDPR rules required on our project we need to encrypt not only passwords or keys, but also other user data such as name, email, etc. Is there a possibility to define what user data should be encrypted in DB? …

---

## [How to set database address?](https://forum.keycloak.org/t/how-to-set-database-address/14600)

<div class="topic-metadata">

**Author:** [@maaverik](https://forum.keycloak.org/u/maaverik)\
**Replies:** 6\
**Last updated:** [July 10, 2024, 4:37am UTC](https://forum.keycloak.org/t/how-to-set-database-address/14600 "2024-07-10T04:37:15Z")

</div>

I’m currently trying to run keycloak in docker with an external database. I’m following this link: Keycloak - Server - Running Keycloak in a container I keep getting a “Connection to localhost:5432 refused” error but I…

---

## [How to rotate DB connection credentials using AWS Secret Manager without restarting the KeyCloak pod](https://forum.keycloak.org/t/how-to-rotate-db-connection-credentials-using-aws-secret-manager-without-restarting-the-keycloak-pod/26658)

<div class="topic-metadata">

**Author:** [@gurteksingh](https://forum.keycloak.org/u/gurteksingh)\
**Replies:** 0\
**Last updated:** [June 25, 2024, 5:41am UTC](https://forum.keycloak.org/t/how-to-rotate-db-connection-credentials-using-aws-secret-manager-without-restarting-the-keycloak-pod/26658 "2024-06-25T05:41:25Z")

</div>

I have KeyCloak deployed in Kubernetes with external database. I am using AWS Secrets Manager to generate and automatically rotate secrets for my DB credentials (password). From my research, when DB secret is rotated in…

---

## [Keycloak operator 25.0.0 upgrade instance fails on db migration](https://forum.keycloak.org/t/keycloak-operator-25-0-0-upgrade-instance-fails-on-db-migration/26427)

<div class="topic-metadata">

**Author:** [@lauer](https://forum.keycloak.org/u/lauer)\
**Replies:** 2\
**Last updated:** [June 11, 2024, 1:01pm UTC](https://forum.keycloak.org/t/keycloak-operator-25-0-0-upgrade-instance-fails-on-db-migration/26427 "2024-06-11T13:01:28Z")

</div>

So our KeyCloak operator automatic updated to v25.0.0, and hereafter our deployed instance container stopped working. { "timestamp": "2024-06-10T15:38:07.803176109Z", "sequence": 9868, "loggerClassName": "or…

---

## [Where are the Postgres Tables?](https://forum.keycloak.org/t/where-are-the-postgres-tables/18068)

<div class="topic-metadata">

**Author:** [@c-bik](https://forum.keycloak.org/u/c-bik)\
**Replies:** 1\
**Last updated:** [May 14, 2024, 9:29pm UTC](https://forum.keycloak.org/t/where-are-the-postgres-tables/18068 "2024-05-14T21:29:22Z")

</div>

Hi, I am trying to understand when and which tables Keycloak 19.0 creates in Postgres. While Keycloak at http://localhost:8080 runs without any issues (change password, create clients etc), When I get into Postgres to …

---

## [Keycloak crash because DB resources "every two weeks"](https://forum.keycloak.org/t/keycloak-crash-because-db-resources-every-two-weeks/25865)

<div class="topic-metadata">

**Author:** [@michal\_p](https://forum.keycloak.org/u/michal_p)\
**Replies:** 0\
**Last updated:** [May 6, 2024, 9:05am UTC](https://forum.keycloak.org/t/keycloak-crash-because-db-resources-every-two-weeks/25865 "2024-05-06T09:05:21Z")

</div>

Hello we have noticed that after around 2 weeks in our usecase, we lost Keycloak connection to database. Keycloak not crash itself. It is just not have DB resources. So each operation end finally with exception as it is …

---

## [Connect to host oracle database from inside the container](https://forum.keycloak.org/t/connect-to-host-oracle-database-from-inside-the-container/24896)

<div class="topic-metadata">

**Author:** [@25khattab](https://forum.keycloak.org/u/25khattab)\
**Replies:** 0\
**Last updated:** [March 5, 2024, 6:01pm UTC](https://forum.keycloak.org/t/connect-to-host-oracle-database-from-inside-the-container/24896 "2024-03-05T18:01:52Z")

</div>

Hi so Im facing this problem which I’m not able to connect to oracle database from inside the container, Im using keycloak image but don’t think that does matter because when I run it locally it works fine but it can’t d…

---

## [401 unauthorized](https://forum.keycloak.org/t/401-unauthorized/24612)

<div class="topic-metadata">

**Author:** [@Hug0-stiglitz](https://forum.keycloak.org/u/Hug0-stiglitz)\
**Replies:** 0\
**Last updated:** [February 16, 2024, 4:48pm UTC](https://forum.keycloak.org/t/401-unauthorized/24612 "2024-02-16T16:48:50Z")

</div>

We have a highly available deployment Keycloak in kubernetes cluster. We have created client with “service accounts roles” and “direct grant acces” which receives infomation users employyeID. After upgrade from 20.01 to …

---

## [Database High Availability and Failover](https://forum.keycloak.org/t/database-high-availability-and-failover/24478)

<div class="topic-metadata">

**Author:** [@davsum](https://forum.keycloak.org/u/davsum)\
**Replies:** 0\
**Last updated:** [February 8, 2024, 6:45pm UTC](https://forum.keycloak.org/t/database-high-availability-and-failover/24478 "2024-02-08T18:45:32Z")

</div>

Have a two instance postgresql database cluster setup as one writer and the other in read only. A failover event changes the read only instance to write. How does one configure keycloak 15.0.2 to gracefully handle a fail…

---

## [MS SQL Server trustServerCertificate property not working](https://forum.keycloak.org/t/ms-sql-server-trustservercertificate-property-not-working/22599)

<div class="topic-metadata">

**Author:** [@jasonh](https://forum.keycloak.org/u/jasonh)\
**Replies:** 3\
**Last updated:** [February 1, 2024, 7:53pm UTC](https://forum.keycloak.org/t/ms-sql-server-trustservercertificate-property-not-working/22599 "2024-02-01T19:53:33Z")

</div>

I’m trying to setup keycloak 21.1.1 with an MS SQL Server database but keep receiving this error: 2023-06-12 02:56:06,791 ERROR \[org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler\] (main) ERROR: Failed to obtain…

---

## [Keycloak High Availability with PostgreSQL on Kubernetes](https://forum.keycloak.org/t/keycloak-high-availability-with-postgresql-on-kubernetes/24266)

<div class="topic-metadata">

**Author:** [@zackbradys](https://forum.keycloak.org/u/zackbradys)\
**Replies:** 0\
**Last updated:** [January 29, 2024, 9:26am UTC](https://forum.keycloak.org/t/keycloak-high-availability-with-postgresql-on-kubernetes/24266 "2024-01-29T09:26:02Z")

</div>

GitHub Issue… Keycloak High Availability with PostgreSQL on Kubernetes · Issue #26550 · keycloak/keycloak · GitHub Describe the bug Keycloak (and Postgres) will deploy without issue and become ready, but when accessing …

---

## [What is the best way to add a new Entity to the model?](https://forum.keycloak.org/t/what-is-the-best-way-to-add-a-new-entity-to-the-model/2859)

<div class="topic-metadata">

**Author:** [@cristiandmt](https://forum.keycloak.org/u/cristiandmt)\
**Replies:** 4\
**Last updated:** [January 8, 2024, 7:00pm UTC](https://forum.keycloak.org/t/what-is-the-best-way-to-add-a-new-entity-to-the-model/2859 "2024-01-08T19:00:03Z")

</div>

Hi everyone, What is the best way to add a new Entity to the model and store it in the database? I would like to add a custom table with a column id that is autoincrement. Thanks in advance for your help.

---

## [Difference in table schema on fresh installation and upgrade](https://forum.keycloak.org/t/difference-in-table-schema-on-fresh-installation-and-upgrade/23939)

<div class="topic-metadata">

**Author:** [@Deeps](https://forum.keycloak.org/u/Deeps)\
**Replies:** 0\
**Last updated:** [January 4, 2024, 8:12pm UTC](https://forum.keycloak.org/t/difference-in-table-schema-on-fresh-installation-and-upgrade/23939 "2024-01-04T20:12:01Z")

</div>

Hi, I am upgrading my keycloak from keycloak-9.0.0 to keycloak-15.1.1 as part of my application upgrade. I did a fresh installation of database and also tried upgrading my database by running the upgrade scripts. But I …

---

## [Keycloak Quarkus distributions not retaining data after docker compose down](https://forum.keycloak.org/t/keycloak-quarkus-distributions-not-retaining-data-after-docker-compose-down/23182)

<div class="topic-metadata">

**Author:** [@davidquack](https://forum.keycloak.org/u/davidquack)\
**Replies:** 1\
**Last updated:** [November 1, 2023, 6:22am UTC](https://forum.keycloak.org/t/keycloak-quarkus-distributions-not-retaining-data-after-docker-compose-down/23182 "2023-11-01T06:22:00Z")

</div>

Hi All, I have this docker compose file that starts Keycloak version 22 in development mode. The idea is to have a postgresql db retaining the user data after “docker compose down” the code below works with keycloak w…

---

## [Token get unauthorized in cluster even for active session](https://forum.keycloak.org/t/token-get-unauthorized-in-cluster-even-for-active-session/23256)

<div class="topic-metadata">

**Author:** [@ddushan123](https://forum.keycloak.org/u/ddushan123)\
**Replies:** 0\
**Last updated:** [November 6, 2023, 1:47pm UTC](https://forum.keycloak.org/t/token-get-unauthorized-in-cluster-even-for-active-session/23256 "2023-11-06T13:47:19Z")

</div>

I’m using keycloak 16.1.1 with two node cluster. If one node shutdown I’ll get 401 unauthorized response with the below message for valid token. { "error": "invalid\_request", "error\_description": "User session n…

---

## [Oracle Support in the future](https://forum.keycloak.org/t/oracle-support-in-the-future/23247)

<div class="topic-metadata">

**Author:** [@mafu](https://forum.keycloak.org/u/mafu)\
**Replies:** 3\
**Last updated:** [November 6, 2023, 7:35am UTC](https://forum.keycloak.org/t/oracle-support-in-the-future/23247 "2023-11-06T07:35:56Z")

</div>

Hello everyone My team is thinking about switching to Keycloak. Since we use an Oracle Database for other purposes already, we would like to keep using it with Keycloak as well. This is possible, and we were able to set…

---

## [Keycloak 3.4.3 keep session on JDBC databaase?](https://forum.keycloak.org/t/keycloak-3-4-3-keep-session-on-jdbc-databaase/23134)

<div class="topic-metadata">

**Author:** [@jbianco](https://forum.keycloak.org/u/jbianco)\
**Replies:** 0\
**Last updated:** [October 28, 2023, 12:27am UTC](https://forum.keycloak.org/t/keycloak-3-4-3-keep-session-on-jdbc-databaase/23134 "2023-10-28T00:27:12Z")

</div>

Hi, I have an old Keycloak v3.4.3 in Debian. Unfortunately I cannot upgrade to a recent version, at the moment. I need a way to delete a particular user session, via an API? or if I can setup Keycloak to store the user …

---

## [Codecentric's Helm Chart for Keycloak](https://forum.keycloak.org/t/codecentrics-helm-chart-for-keycloak/22995)

<div class="topic-metadata">

**Author:** [@NoahNL](https://forum.keycloak.org/u/NoahNL)\
**Replies:** 3\
**Last updated:** [October 20, 2023, 8:11am UTC](https://forum.keycloak.org/t/codecentrics-helm-chart-for-keycloak/22995 "2023-10-20T08:11:00Z")

</div>

Dear Keyclokians, I have a web application I want to use Keycloak to authenticate users. The application will consist of several microservices deployed to a K8s cluster. I was thinking about using this Helm Chart:https:…

---

## [Keycloak using ORACLE and Kerberos](https://forum.keycloak.org/t/keycloak-using-oracle-and-kerberos/22979)

<div class="topic-metadata">

**Author:** [@PaulGarnham](https://forum.keycloak.org/u/PaulGarnham)\
**Replies:** 0\
**Last updated:** [October 17, 2023, 11:47pm UTC](https://forum.keycloak.org/t/keycloak-using-oracle-and-kerberos/22979 "2023-10-17T23:47:51Z")

</div>

I am on Keycloak 21, using Oracle as my local store. I need to use Kerberos to provide the database credentials. I need to be able to do this when running as a local installed instance and as a docker image install. He…

[Next page](https://forum.keycloak.org/tag/database/67.md?match_all_tags=true&page=1&tags%5B%5D=database)
