使用MySQL官方镜像,初始化/docker-entrypoint-initdb.d/sql文件时间太长的问题
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论