I would like to import my realm to database. In keycloak 18 I can call command kc.sh start --import-realm
It works great, but only if there is no realm in the external database.
I tried to import the realm with the command:
docker run
-v ~/realm/:/opt/keycloak/data/import
-e KC_DB_PASSWORD=pass
-e KC_DB_USERNAME=db
-e KC_DB_URL="jdbc:mysql://mydburl/keycloak"
quay.io/keycloak/keycloak:18.0.2
import
--file /opt/keycloak/data/import/realm-export.json
--override true
but I get error:
No suitable driver found for jjdbc:mysql://mydburl/keycloak
Is there any method to import realm before calling kc.sh start?
How could I import the database drivers into the container without building custom image? I tried to add a parameter
import -Dquarkus.datasource.jdbc.driver=mysql
but it doesn’t work