-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Error on mysql startup with --initialize-insecure
#280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We don't really know a surefire way to make it robust, but there may be cases where the datadir is not empty and the initialize can succeed (files starting with . or directories the user explicitly set with --ignore-db-dir, while if datadir/mysql (the system tables) is missing, mysql can't be expected to work. |
Yeah, I think the files that were in the directory were |
I have exactly the same problem, @luhkevin did you find a way to fix it? |
I think unless we have a reliable way to reproduce this, there's not much more we can do to help -- this does indeed sound like a previous initialization which failed, causing subsequent runs to also fail. Since we can't reproduce, I'm going to close, but if a reliable reproducer can be found, a new detailed issue would be appreciated! Thanks! |
Facing the same problem here pls could any one explain the solution neatly |
@Jumaev: When the container starts, if /var/lib/mysql/mysql does not exist, mysqld --initialize-insecure will be executed. --initialize requires /var/lib/mysql to be empty (but can be configured to ignore specific files). If you're seeing this issue, presumably you're mounting /var/lib/mysql to the host, with something like |
I am running into this after another error on the first start. The mounted data directory is empty on the first start, but it fails. On the 2nd start this error occurs. First start:
Second start:
I am interested in solving the first error, the second is just a result of the first. The data directory is completely empty before the first start. EDIT: |
Looks like it ran out of memory; does your system have enough available for
MySQL?
|
@tianon See my edit, it had nothing to do with memory, really weird behavior, could be something docker-compose specific. |
Ah, are you on Docker for Mac, Docker for Windows, or Docker Toolbox? (if so, it could be #99 and/or changes in MySQL that no longer work on the shared folders) |
No, just a normal folder in Ubuntu, nothing shared or the like. |
I was running mysql:5.7 with volume mounts and encountered this error:
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#L80According 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?The text was updated successfully, but these errors were encountered: