Downgrading to mysql 9.2
Some checks failed
Java CI with Gradle / build (17) (push) Failing after 1s
Java CI with Maven / build (17) (push) Failing after 1s
Deploy and Test Cluster / deploy-and-test-cluster (push) Successful in 1m39s

- MySQL 9.3 does not work with testcontainers 1.21.0. Database container terminates with errors

Signed-off-by: Patrick Baumgartner <contact@patbaumgartner.com>
This commit is contained in:
Patrick Baumgartner 2025-06-04 22:21:33 +02:00 committed by Dave Syer
parent 2e61f19c66
commit cefaf55dd1
4 changed files with 6 additions and 4 deletions

View file

@ -54,7 +54,7 @@ A similar setup is provided for MySQL and PostgreSQL if a persistent database co
You can start MySQL or PostgreSQL locally with whatever installer works for your OS or use docker:
```bash
docker run -e MYSQL_USER=petclinic -e MYSQL_PASSWORD=petclinic -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=petclinic -p 3306:3306 mysql:9.3
docker run -e MYSQL_USER=petclinic -e MYSQL_PASSWORD=petclinic -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=petclinic -p 3306:3306 mysql:9.2
```
or

View file

@ -1,6 +1,6 @@
services:
mysql:
image: mysql:9.3
image: mysql:9.2
ports:
- "3306:3306"
environment:

View file

@ -36,6 +36,7 @@ import org.springframework.web.client.RestTemplate;
import org.testcontainers.containers.MySQLContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.utility.DockerImageName;
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@ActiveProfiles("mysql")
@ -46,7 +47,7 @@ class MySqlIntegrationTests {
@ServiceConnection
@Container
static MySQLContainer<?> container = new MySQLContainer<>("mysql:9.3");
static MySQLContainer<?> container = new MySQLContainer<>(DockerImageName.parse("mysql:9.2"));
@LocalServerPort
int port;

View file

@ -22,6 +22,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.testcontainers.containers.MySQLContainer;
import org.testcontainers.utility.DockerImageName;
/**
* PetClinic Spring Boot Application.
@ -35,7 +36,7 @@ public class MysqlTestApplication {
@Profile("mysql")
@Bean
static MySQLContainer<?> container() {
return new MySQLContainer<>("mysql:9.3");
return new MySQLContainer<>(DockerImageName.parse("mysql:9.2"));
}
public static void main(String[] args) {