MySQL container failing to run initialisation scripts in Docker Compose

后端 未结 1 1222
北荒
北荒 2021-01-06 18:43

I am having issues getting my MySQL container to run some initialisation scripts (creating some databases) from Docker Compose. As per the documentation on Docker Hub, I mo

相关标签:
1条回答
  • 2021-01-06 19:30

    Check if this is a docker-compose issue (like issue 115 which redirected to issue 2266)

    I don't think the error is related to build, it's mostly likely volumes.
    Compose preserves volumes so that you don't lose data (this will be better documented in the next release).

    To remove those volumes run docker-compose rm -vf. The next time you docker-compose up it should start with fresh empty volumes.

    According to hub.docker.com/mysql, check also if this is not a synchronization issue:

    If there is no database initialized when the container starts, then a default database will be created. While this is the expected behavior, this means that it will not accept incoming connections until such initialization completes. This may cause issues when using automation tools, such as docker-compose, which start several containers simultaneously.

    0 讨论(0)
提交回复
热议问题