为什么 mysqld 在 5.6 和 5.7 的官方 Percona docker 图像中启动之前关闭

Why does mysqld shutdown before starting in the official Percona docker image for 5.6 and 5.7

我注意到这一点是因为我问的问题 。用普通的

docker run percona:5.6

docker run percona:5.7

日志显示 mysqld 在再次启动之前关闭。没有错误:

2020-08-02T00:17:56.392322Z 0 [Note] mysqld: ready for connections.
Version: '5.7.30-33'  socket: '/var/lib/mysql/mysql.sock'  port: 0  Percona Server (GPL), Release 33, Revision 6517692
mysql: [Warning] Using a password on the command line interface can be insecure.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' 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.
mysql: [Warning] Using a password on the command line interface can be insecure.

2020-08-02T00:17:59.781414Z 0 [Note] Giving 0 client threads a chance to die gracefully
2020-08-02T00:17:59.781467Z 0 [Note] Shutting down slave threads
...
2020-08-02T00:18:02.031635Z 0 [Note] mysqld: Shutdown complete

此行为在运行中以及 Mac 和 Ubuntu 中是一致的。我能做些什么来防止这种情况发生吗?什么是检查它是否永远正常的好方法?好像没有了,只能等了。它不会发生在 8.0.

mysqld的第一个运行是以bootstrap方式初始化数据目录

第二个 运行 是作为服务启动的 mysqld,它将提供 boostrap 提供的所有身份验证和初始化。

Percona dockerhub reference(在:“MySQL 初始化完成之前没有连接”header)表示当连接可用时它就可以开始了。

入口点的源代码是at this github url