2

I'm adding MySQL as a datasource to wildfly

I can insert the useSSL=false parameter to the connection-url tag via jboss-cli.sh

this works perfectly but when I launch the server it tells me to explicitly set useSSL=false

/subsystem=datasources/data-source=KeycloakMysqlDS:add(
    jndi-name=java:jboss/datasources/KeycloakMysqlDS, 
    driver-name=mysql, 
    connection-url=jdbc:mysql://localhost:3306/keycloak,
    user-name=keycloak,
    password=keycloak,
    max-pool-size=15,
    min-pool-size=5
)

if I use this with jboss-cli.sh

connection-url=jdbc:mysql://localhost:3306/keycloak?useSSL=false

I get this error

{
    "outcome" => "failed",
    "failure-description" => "WFLYCTL0097: Wrong type for 'connection-url'. Expected [EXPRESSION, STRING] but was OBJECT",
    "rolled-back" => true
}

is there a way to do this via jboss-cli.sh?

Pako
  • 339
  • 2
  • 8
  • 20

1 Answers1

7

The line fails because it contains a double assignment. You should escape the equals sign of the url query (useSSL\=false).

This:

[standalone@localhost:9990 /] /subsystem=datasources/data-source=KeycloakMysqlDS:add( \
>     jndi-name=java:jboss/datasources/KeycloakMysqlDS, \
>     driver-name=mysql, \
>     connection-url=jdbcmysql://localhost:3306/keycloak?useSSL\=false, \
>     user-name=keycloak, \ 
>     password=keycloak, \
>     max-pool-size=15, \
>     min-pool-size=5 \
> )
{
    "outcome" => "success",
    "response-headers" => {"process-state" => "reload-required"}
}

should work.

Ramon Rockx
  • 101
  • 1
  • 2