View Source Testcontainers.Container.MySqlContainer (testcontainers v1.1.0)

Functions to build and interact with MySql containers.

Summary

Functions

Returns the connection parameters to connect to the database from the host machine.

Builds a MySql container.

Returns the port on the host machine where the MySql container is listening.

Functions

Link to this function

connection_parameters(container, options \\ [])

View Source

Returns the connection parameters to connect to the database from the host machine.

Link to this function

new(image \\ "mysql:8.0", opts \\ [])

View Source

Builds a MySql container.

Uses MySql 8.0 by default, but a custom image can also be set.

Options

  • username sets the username for the user
  • password sets the password for the user
  • database sets the name of the database

Returns the port on the host machine where the MySql container is listening.

Link to this function

with_database(container, database)

View Source
Link to this function

with_password(container, password)

View Source
Link to this function

with_user(container, user)

View Source