🚨 AtomicJar is now part of Docker 🐋! Read the blog

Description

MySQL is an open-source relational database management system.

Examples

Dependency:
<dependency>
    <groupId>org.testcontainers</groupId>
    <artifactId>mysql</artifactId>
    <version>1.20.0</version>
    <scope>test</scope>
</dependency>
Usage:
var mysql = new MySQLContainer<>(DockerImageName.parse("mysql:5.7.34"));
mysql.start();
Dependency:
go get github.com/testcontainers/testcontainers-go/modules/mysql
Usage:
mysqlContainer, err := mysql.Run(ctx, "mysql:5.7.34")
Dependency:
dotnet add package Testcontainers.MySql --version 3.9.0
Usage:
var mySqlContainer = new MySqlBuilder()
  .WithImage("mysql:8.0")
  .Build();
await mySqlContainer.StartAsync();
Dependency:
npm install @testcontainers/mysql --save-dev
Usage:
const container = await new MySqlContainer().start();
Dependency:
pip install testcontainers[mysql]
Usage:
with MySqlContainer('mysql:5.7.17') as mysql:
    engine = sqlalchemy.create_engine(mysql.get_connection_url())