# \[org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler\] (main) ERROR: No database selected

**URL:** <https://forum.keycloak.org/t/org-keycloak-quarkus-runtime-cli-executionexceptionhandler-main-error-no-database-selected/21367>\
**Category:** Miscellanaeous\
**Created:** [April 8, 2023, 4:50pm UTC](https://forum.keycloak.org/t/org-keycloak-quarkus-runtime-cli-executionexceptionhandler-main-error-no-database-selected/21367 "2023-04-08T16:50:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kdres1989](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/kdres1989/32/8207_2.png) [@kdres1989](https://forum.keycloak.org/u/kdres1989)\
**Post date:** [April 8, 2023, 4:50pm UTC](https://forum.keycloak.org/t/org-keycloak-quarkus-runtime-cli-executionexceptionhandler-main-error-no-database-selected/21367/1 "2023-04-08T16:50:23Z")

</div>

2023-04-08 11:43:38 2023-04-08 16:43:38,456 INFO [org.keycloak.broker.provider.AbstractIdentityProviderMapper] (main) Registering class org.keycloak.broker.provider.mappersync.ConfigSyncEventListener  
2023-04-08 11:43:40 2023-04-08 16:43:40,511 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (main) SQL Error: 1046, SQLState: 3D000  
2023-04-08 11:43:40 2023-04-08 16:43:40,511 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (main) No database selected  
2023-04-08 11:43:40 2023-04-08 16:43:40,808 INFO [org.infinispan.CLUSTER] (main) ISPN000080: Disconnecting JGroups channel `ISPN`  
2023-04-08 11:43:40 2023-04-08 16:43:40,885 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (production) mode  
2023-04-08 11:43:40 2023-04-08 16:43:40,886 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: org.hibernate.exception.GenericJDBCException: could not extract ResultSet  
2023-04-08 11:43:40 2023-04-08 16:43:40,886 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: could not extract ResultSet  
2023-04-08 11:43:40 2023-04-08 16:43:40,886 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: No database selected  
2023-04-08 11:43:40 2023-04-08 16:43:40,886 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) For more details run the same command passing the ‘–verbose’ option. Also you can use ‘–help’ to see the details about the usage of the particular command

I need help with this error when starting keycloak

Dockerfile:

FROM [Quay](http://quay.io/keycloak/keycloak:latest) as builder

# Enable health and metrics support

ENV KC\_HEALTH\_ENABLED=true

ENV KC\_METRICS\_ENABLED=true

# Configure a database vendor

ENV JDBC\_MYSQL\_VERSION 8.0.34

ENV KC\_DB=mysql

WORKDIR /opt/keycloak

# for demonstration purposes only, please make sure to use proper certificates in production instead

RUN keytool -genkeypair -storepass password -storetype PKCS12 -keyalg RSA -keysize 2048 -dname “CN=server” -alias server -ext “SAN:c=DNS:localhost,IP:127.0.0.1” -keystore conf/server.keystore

RUN /opt/keycloak/bin/kc.sh build

FROM [Quay](http://quay.io/keycloak/keycloak:latest)

COPY --from=builder /opt/keycloak/ /opt/keycloak/

# change these values to point to a running postgres instance

ENV KC\_DB=mysql

ENV KC\_DB\_URL=jdbc:mysql://dbkeycloak.cluster-ckr12345.us-east-1.rds.amazonaws.com

ENV KC\_DB\_USERNAME=keycloak

ENV KC\_DB\_PASSWORD=12345

ENV KC\_DB\_SCHEMA=Autenticacion

ENV KC\_HOSTNAME=localhost

ENTRYPOINT [“/opt/keycloak/bin/kc.sh”]

---

<div class="post-metadata">

**Author:** ![shankaryadavy9](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/shankaryadavy9/32/1799_2.png) [@shankaryadavy9](https://forum.keycloak.org/u/shankaryadavy9)\
**Post date:** [April 9, 2023, 1:30pm UTC](https://forum.keycloak.org/t/org-keycloak-quarkus-runtime-cli-executionexceptionhandler-main-error-no-database-selected/21367/2 "2023-04-09T13:30:00Z")

</div>

It should be

> [@](#):
>
> jdbc:mysql://\<host\>:\<port\>/\<schema\>

e.g

> [@](#):
>
> jdbc:mysql://dbkeycloak.cluster-ckr12345.us-east-1.rds.amazonaws.com:3306/keycloak

Please the official docs for more info.

> **[All configuration - Keycloak](https://www.keycloak.org/server/all-config)**
>
> Keycloak is an open source identity and access management solution
