Keycloak setting up with mysql

As per client requirement, we are using the Keycloak identity server and they want to use MySQL DB to store Keycloak data.

I followed this link https://github.com/CodepediaOrg/bookmarks.dev/wiki/Keycloak-MySQL-Setup to setup Mysql database. when I run the keycloak, database schemes are created but the keycloak server was not started.

Below are the versions currently I am using
keycloak - 9.0.3
MySQL : 8.0.19 MySQL Community Server

Could you please help me to fix this issue.

am getting this log error message

00:46:15,493 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool – 68) WFLYUT0021: Registered web context: ‘/auth’ for server ‘default-server’
00:46:15,515 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation (“add”) failed - address: ([
(“core-service” => “management”),
(“management-interface” => “http-interface”)
]) - failure description: {“WFLYCTL0080: Failed services” => {“org.wildfly.management.http.extensible” => “java.net.BindException: Address already in use: bind /127.0.0.1:9990”}}
00:46:15,600 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation (“add”) failed - address: ([
(“core-service” => “management”),
(“management-interface” => “http-interface”)
]) - failure description: {“WFLYCTL0080: Failed services” => {“org.wildfly.management.http.extensible” => “java.net.BindException: Address already in use: bind /127.0.0.1:9990”}}
00:46:15,638 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool – 68) WFLYUT0022: Unregistered web context: ‘/auth’ from server ‘default-server’
00:46:15,674 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool – 68) WFLYCLINF0003: Stopped sessions cache from keycloak container
00:46:15,675 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool – 59) WFLYCLINF0003: Stopped work cache from keycloak container
00:46:15,685 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool – 68) WFLYCLINF0003: Stopped authenticationSessions cache from keycloak container
00:46:15,681 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool – 60) WFLYCLINF0003: Stopped loginFailures cache from keycloak container
00:46:15,680 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool – 57) WFLYCLINF0003: Stopped offlineClientSessions cache from keycloak container
00:46:15,677 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool – 64) WFLYCLINF0003: Stopped keys cache from keycloak container
00:46:15,677 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool – 56) WFLYCLINF0003: Stopped users cache from keycloak container
00:46:15,677 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool – 63) WFLYCLINF0003: Stopped authorization cache from keycloak container
00:46:15,683 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool – 66) WFLYCLINF0003: Stopped offlineSessions cache from keycloak container
00:46:15,680 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool – 61) WFLYCLINF0003: Stopped actionTokens cache from keycloak container
00:46:15,682 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool – 67) WFLYCLINF0003: Stopped clientSessions cache from keycloak container
00:46:15,712 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool – 65) WFLYCLINF0003: Stopped realms cache from keycloak container
00:46:15,728 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0028: Stopped deployment keycloak-server.war (runtime-name: keycloak-server.war) in 108ms
00:46:15,754 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0008: Undertow HTTPS listener https suspending
00:46:15,768 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0007: Undertow HTTPS listener https stopped, was bound to 127.0.0.1:8443
00:46:15,777 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool – 65) WFLYCLINF0003: Stopped client-mappings cache from ejb container
00:46:15,813 INFO [org.jboss.as.mail.extension] (MSC service thread 1-3) WFLYMAIL0002: Unbound mail session [java:jboss/mail/Default]
00:46:15,830 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0019: Stopped Driver service with driver-name = h2
00:46:15,829 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0019: Host default-host stopping
00:46:15,823 ERROR [org.jboss.as.server] (ServerService Thread Pool – 55) WFLYSRV0022: Deploy of deployment “keycloak-server.war” was rolled back with no failure message
00:46:15,821 INFO [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0008: Undertow HTTP listener default suspending
00:46:15,819 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) WFLYJCA0010: Unbound data source [java:/jboss/datasources/KeycloakDS]
00:46:15,817 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) WFLYJCA0010: Unbound data source [java:jboss/datasources/ExampleDS]
00:46:15,896 INFO [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0007: Undertow HTTP listener default stopped, was bound to 127.0.0.1:8080
00:46:15,906 INFO [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0004: Undertow 2.0.27.Final stopping
00:46:15,933 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0019: Stopped Driver service with driver-name = mysql
00:46:15,957 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
00:46:15,977 INFO [org.jboss.as] (MSC service thread 1-7) WFLYSRV0050: Keycloak 9.0.3 (WildFly Core 10.0.3.Final) stopped in 13ms

=> some app is already using port 9990. Stop that app and then try to start Keycloak again.

You can start server using standalone.bat -Djboss.socket.binding.port-offset=10 which will start ur server at 8090 instead of 8080