本文介绍了为什么在5.6和5.7的官方Percona Docker映像中启动之前mysqld会关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到这个问题是因为我问了。

I noticed this because of the question I asked here. With a plain

docker run percona:5.6

docker run percona:5.7

日志显示 mysqld 已关闭,然后再次正常启动。没有错误:

the logs show that mysqld shuts down before starting up again for good. There are no errors:

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 上不会发生。

This behavior is consistent across runs, and across Mac and Ubuntu. Is there anything I can do to prevent this? And what would be a good way to check whether it's up for good? It seems like there might not be one, besides just waiting. It doesn't happen on 8.0.

推荐答案

mysqld是引导模式下数据目录的初始化。

The first run of mysqld is an initialization of the data directory in a bootstrap mode.

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

The second run is mysqld starting as a service will all the authentication and initialization that the boostrap provided.

(在以下位置:在MySQL初始化完成之前没有连接

Percona dockerhub reference (under: "No connections until MySQL init complete" header) indicates that when a connection is available its ready to start.

入口点的源代码为。

这篇关于为什么在5.6和5.7的官方Percona Docker映像中启动之前mysqld会关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 02:24