Skip to content
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

docker-compose mysql immediately stops after running #663

Closed
GregNing opened this issue Apr 22, 2020 · 6 comments
Closed

docker-compose mysql immediately stops after running #663

GregNing opened this issue Apr 22, 2020 · 6 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@GregNing
Copy link

GregNing commented Apr 22, 2020

2020-04-22 03:34:07+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.19-1debian10 started.
2020-04-22 03:34:07+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-04-22 03:34:07+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.19-1debian10 started.
2020-04-22 03:34:07+00:00 [Note] [Entrypoint]: Initializing database files
2020-04-22T03:34:08.009082Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2020-04-22T03:34:08.009208Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.19) initializing of server in progress as process 43
2020-04-22T03:34:14.464010Z 5 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2020-04-22 03:34:22+00:00 [Note] [Entrypoint]: Database files initialized
2020-04-22 03:34:22+00:00 [Note] [Entrypoint]: Starting temporary server
2020-04-22T03:34:22.611082Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2020-04-22T03:34:22.611299Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.19) starting as process 93
2020-04-22T03:34:24.138900Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2020-04-22T03:34:24.175510Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2020-04-22T03:34:24.241138Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.19'  socket: '/var/run/mysqld/mysqld.sock'  port: 0  MySQL Community Server - GPL.
2020-04-22 03:34:24+00:00 [Note] [Entrypoint]: Temporary server started.
2020-04-22T03:34:24.373771Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/var/run/mysqld/mysqlx.sock'
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
2020-04-22 03:34:30+00:00 [Note] [Entrypoint]: Creating database review_development

2020-04-22 03:34:30+00:00 [Note] [Entrypoint]: Stopping temporary server
2020-04-22T03:34:30.362242Z 11 [System] [MY-013172] [Server] Received SHUTDOWN from user root. Shutting down mysqld (Version: 8.0.19).
2020-04-22T03:34:32.411635Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.19)  MySQL Community Server - GPL.
2020-04-22 03:34:33+00:00 [Note] [Entrypoint]: Temporary server stopped

2020-04-22 03:34:33+00:00 [Note] [Entrypoint]: MySQL init process done. Ready for start up.

2020-04-22T03:34:33.693389Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2020-04-22T03:34:33.693589Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.19) starting as process 1
2020-04-22T03:34:34.389951Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2020-04-22T03:34:34.398477Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2020-04-22T03:34:34.443717Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.19'  socket: '/var/run/mysqld/mysqld.sock'  port

And then the docker run is finished. Any thoughts?

@wglambert wglambert added the question Usability question, not directly related to an error with the image label Apr 22, 2020
@wglambert
Copy link

[Entrypoint]: Temporary server stopped: this is the temporary server the container is initialized with that has stopped

These notices mean the container is fully initialized and ready
[Entrypoint]: MySQL init process done. Ready for start up.
[System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections.

@GregNing
Copy link
Author

GregNing commented Jun 3, 2020

@wglambert thanks !

@scspijker
Copy link

What is the correct health check to prevent your scripts to connect to the temporary server?

@GregNing
Copy link
Author

Hi @scspijker,
I reference this

@tianon
Copy link
Member

tianon commented Nov 29, 2022

See also https://github.com/docker-library/healthcheck/blob/40afbf64d69cf933af0da4df6383958a29113601/mysql/docker-healthcheck (which explicitly uses TCP either to the external IP address of the container or 127.0.0.1 to avoid the temporary server).

@MobCode100
Copy link

(which explicitly uses TCP either to the external IP address of the container or 127.0.0.1 to avoid the temporary server).

Based on this comment and also this answer, my healthcheck is:

    healthcheck:
        test: ["CMD", "mysqladmin", "ping", "-p$$MYSQL_ROOT_PASSWORD","--protocol","tcp"]

because temporary server skips networking so no TCP port is open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

5 participants