使用MySQL官方镜像,初始化/docker-entrypoint-initdb.d/sql文件时间太长的问题

发布于 2022-09-05 10:37:09 字数 2943 浏览 18 评论 0

dockerfile:

FROM mysql:5.6.37

ENV TZ "Asia/Shanghai"
ENV MYSQL_ROOT_PASSWORD=test@2017
ADD binlog.cnf /etc/mysql/conf.d
ADD init.sql /docker-entrypoint-initdb.d/

EXPOSE 22 3306
~

容器启动,随后mysql启动后,有些sql执行时间甚至达到了7分钟,是什么原因
docker logs如下

2017-08-21 12:35:42 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-08-21 12:35:42 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2017-08-21 12:35:42 0 [Note] /usr/sbin/mysqld (mysqld 5.6.37-log) starting as process 37 ...
[root@hub rent_plat]# docker logs 82e2e44114bf47422dcdb89b5a01d43c7037fa91a35644236899e89f38ef9b28
Initializing database
2017-08-21 12:35:42 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-08-21 12:35:42 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2017-08-21 12:35:42 0 [Note] /usr/sbin/mysqld (mysqld 5.6.37-log) starting as process 37 ...


2017-08-21 12:35:59 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-08-21 12:35:59 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2017-08-21 12:35:59 0 [Note] /usr/sbin/mysqld (mysqld 5.6.37-log) starting as process 60 ...




PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  /usr/bin/mysqladmin -u root password 'new-password'
  /usr/bin/mysqladmin -u root -h 82e2e44114bf password 'new-password'

Alternatively you can run:

  /usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

Note: new default config file not created.
Please make sure your config file is current

WARNING: Default config file /etc/mysql/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

Database initialized
MySQL init process in progress...
2017-08-21 12:37:35 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-08-21 12:37:35 0 [Note] mysqld (mysqld 5.6.37-log) starting as process 88 ...```

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文