pie*_*rus 6 mysql mysql-python docker docker-compose
我在网上找不到任何关于此的信息。当我第一次使用mysql启动docker容器时,结果启动非常慢(最多需要5分钟才能启动)。然后接下来的几次我启动它只需要很少的时间,一切都很正常。
docker-compose.yml 是这样的:
version: "3.9"
services:
db:
image: mysql:latest
command: --default-authentication-plugin=mysql_native_password
env_file:
- .env
environment:
MYSQL_RANDOM_ROOT_PASSWORD: ${MYSQL_RANDOM_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_DATABASE_HOST: ${MYSQL_DATABASE_HOST}
MYSQL_DATABASE_PORT: ${MYSQL_DATABASE_PORT}
ports:
- 3307:${MYSQL_DATABASE_PORT}
volumes:
- mysql_data:/var/lib/mysql
volumes:
mysql_data:
Run Code Online (Sandbox Code Playgroud)
相反,这里是 mysql 容器初始化第一阶段获取的日志(左侧可以看到操作的时间戳):
6-testdjangomysqlnginx-db-1 | 2023-01-28 09:47:07+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.32-1.el8 started.
6-testdjangomysqlnginx-db-1 | 2023-01-28 09:47:07+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
6-testdjangomysqlnginx-db-1 | 2023-01-28 09:47:07+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.0.32-1.el8 started.
6-testdjangomysqlnginx-db-1 | 2023-01-28 09:47:08+00:00 [Note] [Entrypoint]: Initializing database files
6-testdjangomysqlnginx-db-1 | 2023-01-28T09:47:08.040438Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
6-testdjangomysqlnginx-db-1 | 2023-01-28T09:47:08.040525Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
6-testdjangomysqlnginx-db-1 | 2023-01-28T09:47:08.040543Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.32) initializing of server in progress as process 80
6-testdjangomysqlnginx-db-1 | 2023-01-28T09:47:08.089681Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
6-testdjangomysqlnginx-db-1 | 2023-01-28T09:47:25.337581Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
6-testdjangomysqlnginx-db-1 | 2023-01-28T09:48:11.724097Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
6-testdjangomysqlnginx-db-1 | 2023-01-28 09:50:11+00:00 [Note] [Entrypoint]: Database files initialized
6-testdjangomysqlnginx-db-1 | 2023-01-28 09:50:11+00:00 [Note] [Entrypoint]: Starting temporary server
6-testdjangomysqlnginx-db-1 | 2023-01-28T09:50:11.764823Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
6-testdjangomysqlnginx-db-1 | 2023-01-28T09:50:11.766216Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Please use authentication_policy instead.
6-testdjangomysqlnginx-db-1 | 2023-01-28T09:50:11.766238Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.32) starting as process 125
6-testdjangomysqlnginx-db-1 | 2023-01-28T09:50:12.515012Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
6-testdjangomysqlnginx-db-1 | 2023-01-28T09:50:14.505933Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
6-testdjangomysqlnginx-db-1 | 2023-01-28T09:50:19.710452Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
6-testdjangomysqlnginx-db-1 | 2023-01-28T09:50:19.710543Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
6-testdjangomysqlnginx-db-1 | 2023-01-28T09:50:19.821511Z 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.
6-testdjangomysqlnginx-db-1 | 2023-01-28T09:50:19.837273Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.32' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server - GPL.
6-testdjangomysqlnginx-db-1 | 2023-01-28T09:50:19.837274Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: /var/run/mysqld/mysqlx.sock
6-testdjangomysqlnginx-db-1 | 2023-01-28 09:50:19+00:00 [Note] [Entrypoint]: Temporary server started.
6-testdjangomysqlnginx-db-1 | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
6-testdjangomysqlnginx-db-1 | Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
6-testdjangomysqlnginx-db-1 | Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
6-testdjangomysqlnginx-db-1 | Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
6-testdjangomysqlnginx-db-1 | Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
6-testdjangomysqlnginx-db-1 | Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
6-testdjangomysqlnginx-db-1 | 2023-01-28 09:50:29+00:00 [Note] [Entrypoint]: GENERATED ROOT PASSWORD: xxxxxxxxxxxxxxxxxxxxxxx
6-testdjangomysqlnginx-db-1 | 2023-01-28 09:50:31+00:00 [Note] [Entrypoint]: Creating database blog
6-testdjangomysqlnginx-db-1 | 2023-01-28 09:50:31+00:00 [Note] [Entrypoint]: Creating user django
6-testdjangomysqlnginx-db-1 | 2023-01-28 09:50:32+00:00 [Note] [Entrypoint]: Giving user django access to schema blog
6-testdjangomysqlnginx-db-1 |
6-testdjangomysqlnginx-db-1 | 2023-01-28 09:50:33+00:00 [Note] [Entrypoint]: Stopping temporary server
6-testdjangomysqlnginx-db-1 | 2023-01-28T09:50:33.252374Z 13 [System] [MY-013172] [Server] Received SHUTDOWN from user root. Shutting down mysqld (Version: 8.0.32).
Run Code Online (Sandbox Code Playgroud)
看来手术时间这么长[Entrypoint]: Database files initialized,正常吗?
| 归档时间: |
|
| 查看次数: |
814 次 |
| 最近记录: |