Open JohnnysMartins opened 1 year ago
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)
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): https://github.com/metabase/metabase/issues/12545#issuecomment-629320966
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:
error: