Шаги, которые делал до появления ошибки -
1. Из гайда по докеру - перенес проект с рабочего стола в папку \\wsl.localhost\Ubuntu-22.04\home\markeze(это юзер)\projects (сделал это для того, чтобы проект быстрее работал на wsl2, ubuntu)
2. Переустановил все зависимости и запустил контейнер
Когда проект находился на рабочем столе - всё было ок
Сама ошибка(после её появления, контейнер с бд перезапускается) -
24-10-12 19:49:36 2024-10-12 16:49:36+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 9.0.1-1.el9 started.
2024-10-12 19:49:36 '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2024-10-12 19:50:07 2024-10-12 16:50:07+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 9.0.1-1.el9 started.
2024-10-12 19:50:07 2024-10-12 16:50:07+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-10-12 19:50:07 2024-10-12 16:50:07+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 9.0.1-1.el9 started.
2024-10-12 19:50:08 '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2024-10-12 19:50:08 2024-10-12T16:50:08.042785Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2024-10-12 19:50:08 2024-10-12T16:50:08.254585Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 9.0.1) starting as process 1
2024-10-12 19:50:08 2024-10-12T16:50:08.255948Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2024-10-12 19:50:08 2024-10-12T16:50:08.255961Z 0 [Warning] [MY-013244] [Server] --collation-server: 'utf8mb3_unicode_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
2024-10-12 19:50:08 2024-10-12T16:50:08.263468Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-10-12 19:50:08 2024-10-12T16:50:08.859504Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-10-12 19:50:08 2024-10-12T16:50:08.880599Z 1 [ERROR] [MY-014060] [Server] Invalid MySQL server upgrade: Cannot upgrade from 80039 to 90001. Upgrade to next major version is only allowed from the last LTS release, which version 80039 is not.
2024-10-12 19:50:08 2024-10-12T16:50:08.880837Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2024-10-12 19:50:08 2024-10-12T16:50:08.880889Z 0 [ERROR] [MY-010119] [Server] Aborting
2024-10-12 19:50:09 2024-10-12T16:50:09.463237Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 9.0.1) MySQL Community Server - GPL.
2024-10-12 19:50:09 2024-10-12T16:50:09.463305Z 0 [System] [MY-015016] [Server] MySQL Server - end.
docker-compose.yml -
version: '3'
services:
web:
image: nginx:latest
volumes:
- ./:/var/www/
- ./_docker/nginx/conf.d/:/etc/nginx/conf.d/
ports:
- "8877:80"
depends_on:
- app
container_name: api
app:
build:
context: .
dockerfile: _docker/app/Dockerfile
volumes:
- ./:/var/www
depends_on:
- db
container_name: api_app
db:
image: mysql:latest
restart: always
volumes:
- ./tmp/db:/var/lib/mysql
environment:
MYSQL_DATABASE: api
MYSQL_ROOT_PASSWORD: root
PMA_HOST: mysql
PMA_PORT: 3306
ports:
- "8101:3306"
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci
container_name: api_db
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
restart: always
ports:
- "8080:80"
environment:
PMA_HOST: db
PMA_USER: root
PMA_PASSWORD: root
depends_on:
- db
dockerfile -
FROM php:8.1-fpm
RUN apt-get update && apt-get install -y \
apt-utils \
libpq-dev \
libpng-dev \
libzip-dev \
zip unzip \
git && \
docker-php-ext-install pdo_mysql && \
docker-php-ext-install bcmath && \
docker-php-ext-install gd && \
docker-php-ext-install zip && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY ./_docker/app/php.ini /usr/local/etc/php/conf.d/php.ini
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN curl -sS https://getcomposer.org/installer | php -- \
--filename=composer \
--install-dir=/usr/local/bin
WORKDIR /var/www
Проект на ларавел, вот конф бд в .env
DB_CONNECTION=db
DB_HOST=db
DB_PORT=3306
DB_DATABASE=api
DB_USERNAME=root
DB_PASSWORD=root
Также вот ошибка из phpmyadmin -