I have been trying to do a POC to use Liquibase docker image for connecting to MYSQL instance and publish DB changes. I have been following these article
https://docs.liquibase.com/workflows/liquibase-community/using-liquibase-and-docker.html https://hub.docker.com/r/liquibase/liquibase https://github.com/Inkimar/liquibase-example - Sample Repo
However I am always getting the below error ->
**Connection could not be created to jdbc:mysql://localhost:3306/denmark with driver
com.mysql.cj.jdbc.Driver. Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has
not received any packets from the server.
liquibase.exception.CommandExecutionException: liquibase.exception.LiquibaseException:
Unexpected error running Liquibase: liquibase.exception.DatabaseExcepti
on: liquibase.exception.DatabaseException: Connection could not be created to
jdbc:mysql://localhost:3306/denmark with driver com.mysql.cj.jdbc.Driver.
Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has
not received any packets from the server.
at liquibase.command.CommandScope.execute(CommandScope.java:163)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:51)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:21)
at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent
(CommandLine.java:2358)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
at picocli.CommandLine.execute(CommandLine.java:2078)
at liquibase.integration.commandline.LiquibaseCommandLine.lambda$execute$1
(LiquibaseCommandLine.java:336)
at liquibase.Scope.child(Scope.java:189)
at liquibase.Scope.child(Scope.java:165)
at liquibase.integration.commandline.LiquibaseCommandLine.execute
(LiquibaseCommandLine.java:301)
at liquibase.integration.commandline.LiquibaseCommandLine.main
(LiquibaseCommandLine.java:90)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at liquibase.integration.commandline.LiquibaseLauncher.main(LiquibaseLauncher.java:91)**
Any luck or pointer is highly appreciated. I have tried using MYSQL 5.7 and 8.x version but no luck.