Skip to content

Error on mysql startup with --initialize-insecure #280

Closed
@luhkevin

Description

@luhkevin

I was running mysql:5.7 with volume mounts and encountered this error:

2017-04-08T00:44:56.022067Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2017-04-08T00:44:56.022080Z 0 [ERROR] Aborting

I see that we pass the --initialize-insecure flag in the entrypoint, but the conditions for "initialization" are if $DATADIR/mysql is empty: https://github.com/docker-library/mysql/blob/master/5.7/docker-entrypoint.sh#L80

According to this reference, --initialize-insecure will fail if the data directory is nonempty.

So wouldn't this create a race condition if I exit mysql during the initialization process, before the mysql directory has a chance to be created?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions