Skip to content

[Bug]: skip-host-cache option removed in latest MySQL 8.3.0 version #8130

Closed

Description

@swaroopar

Module

MySQL

Testcontainers version

1.19.3

Using the latest Testcontainers version?

Yes

Host OS

Linux

Host Arch

x86

Docker version

Github-hosted runner. Cannot check the docker version.

What happened?

The latest mysql contanier 8.3.0 does not work anymore with testcontainers. It complains about an unknown config option - '--skip-host-cache'.

Tests with previous versions work fines. I don't see mention of any change to this config parameter in the 8.3.0 release notes though.

Error: -19T04:32:46.946550Z 0 [ERROR] [MY-000068] [Server] unknown option '--skip-host-cache'.
Error: -19T04:32:46.946911Z 0 [ERROR] [MY-013236] [Server] The designated data directory /var/lib/mysql/ is unusable. You can remove all files that the server added to it.
Error: -19T04:32:46.946926Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-01-19T04:32:48.385535Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end.

Failed Job - https://github.com/eclipse-xpanse/xpanse/actions/runs/7579264089/job/20643575357?pr=1264

Config - https://github.com/testcontainers/testcontainers-java/blob/main/modules/mysql/src/main/resources/mysql-default-conf/my.cnf#L14

Relevant log output

No response

Additional Information

No response

Activity

  1. rowleya commented on Jan 19, 2024

    @rowleya
  2. wimdeblauwe commented on Jan 19, 2024

    @wimdeblauwe
    Contributor

    Running into this as well. The release note of 8.0.30 does mention the deprecation of the parameter:

    The --skip-host-cache server option is now deprecated, and subject to removal in a future release.

    Use a statement such as SET GLOBAL host_cache_size = 0, or set host_cache_size in the my.cnf file, instead. (WL #14359)

    But indeed nothing about the actual removal in the 8.3.0 release notes.

  3. wimdeblauwe commented on Jan 19, 2024

    @wimdeblauwe
    Contributor

    This PR seems to be related: docker-library/mysql#1002

    They replaced skip-host-cache with host_cache_size=0 which is probably what will fix it here as well.

  4. wimdeblauwe commented on Jan 19, 2024

    @wimdeblauwe
    Contributor

    This is a workaround that seems to work for me:

    1. Create a src/main/resources/mysql-default-conf/my.cnf file in your project
    2. Copy the contents of https://github.com/testcontainers/testcontainers-java/blob/main/modules/mysql/src/main/resources/mysql-default-conf/my.cnf into it
    3. Replace the line with skip-host-cache with host_cache_size=0

    After that, tests work again.

  5. rowleya commented on Jan 19, 2024

    @rowleya

    My current workaround is to use mysql 8.2.0 specifically in my application-test.yml file (this is for the unit testing of a Spring Boot application):
    jdbc-url: jdbc:tc:mysql:8.2.0:///;databaseName=<database>?user=<user>&password=<password>

  6. added a commit that references this issue on Jan 23, 2024
    9de26f1
  7. added a commit that references this issue on Jan 18, 2025
    0ccf487
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions