Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSA public key is not available client side (option serverRsaPublicKeyFile not set) #117

Open
JohnnysMartins opened this issue Feb 13, 2023 · 2 comments

Comments

@JohnnysMartins
Copy link

I tried to follow the Official documentation example to run a docker-compose version having a MySQL and flyway image running the migration but an error about RSA public key is been showed

docker-compose.yml example:

version: '3'
services:
  flyway:
    image: flyway/flyway
    command: -url=jdbc:mysql://db -schemas=myschema -user=root -password=P@ssw0rd -connectRetries=60 migrate
    volumes:
      - .:/flyway/sql
    depends_on:
      - db
  db:
    image: mysql
    environment:
      - MYSQL_ROOT_PASSWORD=P@ssw0rd
    command: ["--default-authentication-plugin=mysql_native_password"]
    ports:
      - 3306:3306

error:
image

@fatbasstard
Copy link

Found this on StackOverflow: https://stackoverflow.com/questions/72385060/how-to-connect-to-dockerized-mysql-database-with-flyway

But after that I get the following error:

flyway-1  | WARNING: Connection error: Could not connect to address=(host=db)(port=3306)(type=master) : Socket fail to connect to host:db, port:3306. db
flyway-1  | (Caused by db)

@Blogem
Copy link

Blogem commented Jun 12, 2024

I have solved this issue by changing the command of the flyway container from:

    command: -url=jdbc:mysql://db -schemas=myschema -user=root -password=P@ssw0rd -connectRetries=60 migrate

to:

    command: -url=jdbc:mysql://db?allowPublicKeyRetrieval=true -schemas=myschema -user=root -password=P@ssw0rd -connectRetries=60 migrate

More info here, esp. regarding the security of this (fine for running local containers): metabase/metabase#12545 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants