Я застрял на запуске Docker-контейнера MySQL.
Это часть моего docker-compose. yml:
Код: Выделить всё
mysql:
hostname: a-mysql
container_name: a-mysql
image: mysql:8
restart: unless-stopped
volumes:
- ./mysql_data:/var/lib/mysql
- ./mysql/my.cnf:/etc/mysql/conf.d/my.cnf
- ./mysql/dump:/docker-entrypoint-initdb.d
env_file:
- .env
ports:
- 7306:3306
environment:
TZ: "Asia/Jerusalem"
MYSQL_ALLOW_EMPTY_PASSWORD: "no"
MYSQL_ROOT_PASSWORD: ${MYSQL_INITDB_ROOT_PASSWORD}
MYSQL_USER: ${MYSQL_INITDB_USER}
MYSQL_PASSWORD: ${MYSQL_INITDB_USER_PASSWORD}
MYSQL_DATABASE: ${MYSQL_INITDB}
networks:
- external-php-net
- internal-php-net
command: ["mysqld", "--mysql-native-password=ON"]
#command: --default-authentication-plugin=mysql_native_password
Код: Выделить всё
up: #create and start containers
@docker compose up -d
down: #stop containers
@docker compose down
rebuild: #rebuild all
@docker compose down && docker compose up -d --build
connect_back: #connect to laravel application
@docker exec -it ]php-fpm bash
database-import:
@../excursions.back/database/snapshots/database_import.sh
setup: ## Create and start containers
$(MAKE) up-redis
$(MAKE) up-mysql
$(MAKE) install
$(MAKE) up-frontend
$(MAKE) up-php
#$(MAKE) init
$(MAKE) up-nginx
Что происходит — все контейнеры работают (есть redis, php -fpm, admin и т. д.), но MySQL всегда перезагружается.
У меня есть журнал:
Код: Выделить всё
2024-07-15 15:23:16 2024-07-15T12:23:16.324649Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-07-15 15:23:19 2024-07-15T12:23:19.486488Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-07-15 15:23:21 mysqld: Table 'mysql.plugin' doesn't exist
2024-07-15 15:23:21 2024-07-15T12:23:21.776189Z 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.
2024-07-15 15:23:21 2024-07-15T12:23:21.776800Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-07-15 15:23:21 2024-07-15T12:23:21.777242Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-07-15 15:23:21 2024-07-15T12:23:21.951887Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-07-15 15:23:21 2024-07-15T12:23:21.952560Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-07-15 15:23:21 2024-07-15T12:23:21.952903Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-07-15 15:23:21 2024-07-15T12:23:21.953261Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-07-15 15:23:21 2024-07-15T12:23:21.953587Z 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2024-07-15 15:23:23 2024-07-15T12:23:23.546298Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2024-07-15 15:23:23 2024-07-15T12:23:23.690225Z 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2024-07-15 15:23:23 2024-07-15T12:23:23.805946Z 0 [Warning] [MY-013595] [Server] Failed to initialize TLS for channel: mysql_main. See below for the description of exact issue.
2024-07-15 15:23:23 2024-07-15T12:23:23.806030Z 0 [Warning] [MY-010069] [Server] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2024-07-15 15:23:24 mysqld: Cannot change permissions of the file 'private_key.pem.temp' (OS errno 1 - Operation not permitted)
2024-07-15 15:23:24 2024-07-15T12:23:24.850250Z 0 [ERROR] [MY-010295] [Server] Could not set file permission for private_key.pem
2024-07-15 15:23:24 2024-07-15T12:23:24.850316Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-07-15 15:23:26 2024-07-15T12:23:26.457062Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.1) MySQL Community Server - GPL.
2024-07-15 15:23:26 2024-07-15T12:23:26.457140Z 0 [System] [MY-015016] [Server] MySQL Server - end.
2024-07-15 15:23:29 2024-07-15 15:23:29+03:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.1-1.el9 started.
2024-07-15 15:23:33 2024-07-15 15:23:33+03:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-07-15 15:23:33 2024-07-15 15:23:33+03:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.1-1.el9 started.
2024-07-15 15:23:34 '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2024-07-15 15:23:34 mysqld: [Warning] World-writable config file '/etc/mysql/conf.d/my.cnf' is ignored.
2024-07-15 15:23:35 2024-07-15T12:23:34.607950Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2024-07-15 15:23:35 2024-07-15T12:23:35.265552Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.1) starting as process 1
2024-07-15 15:23:35 2024-07-15T12:23:35.329779Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive
2024-07-15 15:23:35 2024-07-15T12:23:35.381988Z 0 [Warning] [MY-000054] [Server] World-writable config file '/var/lib/mysql/auto.cnf' is ignored.
2024-07-15 15:23:35 2024-07-15T12:23:35.398682Z 0 [Warning] [MY-010107] [Server] World-writable config file '/var/lib/mysql/auto.cnf' has been removed.
2024-07-15 15:23:35 2024-07-15T12:23:35.400891Z 0 [Warning] [MY-010075] [Server] 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: 0e9d63d9-42a5-11ef-b1b9-0242ac130003.
2024-07-15 15:23:35 2024-07-15T12:23:35.533081Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
Хорошо. Я вижу проблему с разрешениями и думаю, что попробовал все, чтобы это исправить: изменил разрешения с помощью chmod, добавил мета-элемент в wsl.cnf и так далее и тому подобное.
Подробнее здесь: https://stackoverflow.com/questions/787 ... -reloading