version: '3.1'
services:
mysql:
container_name: "sob-blog-system-mysql"
network_mode: "host"
environment:
MYSQL_ROOT_PASSWORD: "123456"
MYSQL_USER: 'root'
MYSQL_PASS: '123456'
image: "mysql:5.7.31"
restart: always
ports:
- 3306:3306
volumes:
- "/mnt/c/Users/ChengWei/docker/mysql/db:/var/lib/mysql"
- "/mnt/c/Users/ChengWei/docker/mysql/conf:/etc/mysql"
- "/mnt/c/Users/ChengWei/docker/mysql/log:/var/log/mysql"
用的是上面的docker-compose.yml,但是创建后mysql容器总是不断aborting而后重启,容器的log如下:2020-09-17 13:22:14+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
2020-09-17 13:22:14+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2020-09-17 13:22:14+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.31-1debian10 started.
2020-09-17 13:22:15+00:00 [Note] [Entrypoint]: Initializing database files
2020-09-17T13:22:15.295747Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-09-17T13:22:15.346841Z 0 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2020-09-17T13:22:17.484906Z 0 [Warning] InnoDB: New log files created, LSN=45790
2020-09-17T13:22:17.964250Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2020-09-17T13:22:18.027924Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: cf2edc2f-f8e8-11ea-a3f4-025000000001.
2020-09-17T13:22:18.046982Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
mysqld: Can't change permissions of the file 'ca-key.pem' (Errcode: 1 - Operation not permitted)
2020-09-17T13:22:18.251062Z 0 [ERROR] Could not set file permission for ca-key.pem
2020-09-17T13:22:18.251095Z 0 [ERROR] Aborting
请大家帮忙看看怎么解决这个log?