Docker mysql error 3008

I started command localhost:8080 in asdess bar
But nothi happened there
Here
Client/Dockerfile

FROM node:16.0.0-alpine
 
WORKDIR /app
 
EXPOSE 3000
 
COPY package*.json ./
 
RUN npm install
 
COPY . ./
 
CMD ["npm","run","start"]

docker build -t frontend-auth . Works whithout errors
Server/Dockerfile

FROM node:16.0.0-alpine
 
WORKDIR /app
 
EXPOSE 5000
 
COPY package*.json ./
 
RUN npm install
 
COPY . ./
 
CMD ["npm","run","dev"]

docker build -t backend-auth . Returns one error about mysql (this is normal because mysql is not running)
App/docker-compose.yml

version: '3'
 
services:
  frontend:
    build: ./client
    ports:
      - '3333:3000'
  server:
    build: ./server
    ports:
      - '5555:5000'
  mysql:
    image: mysql:8.4.8
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: author
  adminer:
    image: adminer
    ports:
      - '8888:8080'

here is the error that is returned when running the command docker compose up

mysql-1 | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
mysql-1 | 2026-02-17T10:55:19.072985Z 0 [System] [MY-015015] [Server] MySQL Server - start.
mysql-1 | 2026-02-17T10:55:20.118701Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.8) starting as process 1
mysql-1 | 2026-02-17T10:55:20.153136Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
mysql-1 | 2026-02-17T10:55:21.534813Z 1 [ERROR] [MY-014061] [InnoDB] Invalid MySQL server downgrade: Cannot downgrade from 90600 to 80408. Downgrade is only permitted between patch releases.
mysql-1 | mysqld: Can't open file: 'mysql.ibd' (errno: 0 - )
mysql-1 | 2026-02-17T10:55:21.790245Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
mysql-1 | 2026-02-17T10:55:21.790838Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
mysql-1 | 2026-02-17T10:55:21.790887Z 0 [ERROR] [MY-010119] [Server] Aborting
mysql-1 | 2026-02-17T10:55:21.794834Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.8) MySQL Community Server - GPL.
mysql-1 | 2026-02-17T10:55:21.794979Z 0 [System] [MY-015016] [Server] MySQL Server - end.
server-1 | HostNotFoundError [SequelizeHostNotFoundError]: getaddrinfo ENOTFOUND MySQL-8.4
server-1 | at ConnectionManager.connect (/app/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:96:17)
server-1 | at processTicksAndRejections (node:internal/process/task_queues:96:5)
server-1 | at async ConnectionManager._connect (/app/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:222:24)
server-1 | at async /app/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:174:32
server-1 | at async ConnectionManager.getConnection (/app/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:197:7)
server-1 | at async /app/node_modules/sequelize/lib/sequelize.js:305:26
server-1 | at async Sequelize.authenticate (/app/node_modules/sequelize/lib/sequelize.js:457:5)
server-1 | at async start (/app/index.js:24:9) {
server-1 | parent: Error: getaddrinfo ENOTFOUND MySQL-8.4
server-1 | at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:69:26) {
server-1 | errno: -3008,
server-1 | code: 'ENOTFOUND',
server-1 | syscall: 'getaddrinfo',
server-1 | hostname: 'MySQL-8.4',
server-1 | fatal: true
server-1 | },
server-1 | original: Error: getaddrinfo ENOTFOUND MySQL-8.4
server-1 | at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:69:26) {
server-1 | errno: -3008,
server-1 | code: 'ENOTFOUND',
server-1 | syscall: 'getaddrinfo',
server-1 | hostname: 'MySQL-8.4',
server-1 | fatal: true
server-1 | }
server-1 | }
server-1 | [nodemon] clean exit - waiting for changes before restart
mysql-1 exited with code 1
в бекенде хост базы указан MySQL-8.4 DB_USER=root
0Мультицитирование этого сообщения Быстрый ответ на это сообщение
Norail   [ТС]
-133
Регистрация: 07.01.2023
Сообщений: 85
Вчера, 22:59
Norail на форуме Обратить внимание администрации на это сообщение
[В закладки] [Окно ответа] [2]
если в mysql по ставить restart: always то повторяется следующая ошибка
mysql-1 | 2026-02-17 19:54:51+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.8-1.el9 started.
mysql-1 | 2026-02-17 19:54:52+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
mysql-1 | 2026-02-17 19:54:52+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.4.8-1.el9 started.
mysql-1 | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
mysql-1 | 2026-02-17T19:54:54.228105Z 0 [System] [MY-015015] [Server] MySQL Server - start.
mysql-1 | 2026-02-17T19:54:54.956461Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.8) starting as process 1
mysql-1 | 2026-02-17T19:54:54.982953Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
mysql-1 | 2026-02-17T19:54:56.741781Z 1 [ERROR] [MY-014061] [InnoDB] Invalid MySQL server downgrade: Cannot downgrade from 90600 to 80408. Downgrade is only permitted between patch releases.
mysql-1 | mysqld: Can't open file: 'mysql.ibd' (errno: 0 - )
mysql-1 | 2026-02-17T19:54:57.224131Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
mysql-1 | 2026-02-17T19:54:57.225063Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
mysql-1 | 2026-02-17T19:54:57.225198Z 0 [ERROR] [MY-010119] [Server] Aborting
mysql-1 | 2026-02-17T19:54:57.234078Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.8) MySQL Community Server - GPL.
mysql-1 | 2026-02-17T19:54:57.234201Z 0 [System] [MY-015016] [Server] MySQL Server - end.

Why happened error how fix it

I formatted your post. Please, do it for us next time, because it would be pretty hard to read your question without that for anyone. Use markdown code block syntax or the </> button to start a code block for any temrinal output, code or logs. More help here:

https://forums.docker.com/t/how-to-format-your-forum-posts/127295#p-202628-dockerfiles-compose-files-logs-and-code-4

Do you really get the error while building the image and not when starting the container? Nothing should try to connect to a database and you only have an “npm install” command running in build time. The server would start wen you start the container. And I don’t see any error message in your log indicating on the client side that MySQL is not running, except that the MySQL container indeed shows it could not start due to incompatible data directory.

This part seems to be clear:

mysql-1 | 2026-02-17T10:55:21.534813Z 1 [ERROR] [MY-014061] [InnoDB] Invalid MySQL server downgrade: Cannot downgrade from 90600 to 80408. Downgrade is only permitted between patch releases.
mysql-1 | mysqld: Can't open file: 'mysql.ibd' (errno: 0 - )
mysql-1 | 2026-02-17T10:55:21.790245Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
mysql-1 | 2026-02-17T10:55:21.790838Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
mysql-1 | 2026-02-17T10:55:21.790887Z 0 [ERROR] [MY-010119] [Server] Aborting

This indicates you had a newer MySQL version installed and you used the same data for an older version.

These show that you used “MySQL-8.4” as hostname on the server side, but your compose service is called “mysql”, so you should configure that for hostname in the server container.

now docker returned ConnectionRefusedError [SequelizeConnectionRefusedError]: connect ECONNREFUSED 172.19.0.4:3307
in the search engine, I found that one person had the same error that I had, he solved the problem by changing the mysql port to 3307, I changed the port in both the code and in docker-compose.yml but it didn’t help

Why port 3307? MySQL listens on port 3306 by default, not 3307. I don’t see any 3307 or any other port in your compose under the mysql service, but if you forgot to share that you added port forward, port forward is only needed when you want to access the service from your browser for example. Services communicate over Docker networks, so you can continue using port 3306 for internal connections.

Here docker yml

version: '3'
 
services:
  frontend:
    build: ./client
    ports:
      - '3333:3000'
  server:
    build: ./server
    depends_on:
      - mysql
    ports:
      - '5555:5000'
  mysql:
    image: mysql:8.4
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: author
    ports:
      - '3334:3307'
  adminer:
    image: adminer
    depends_on:
      - mysql
    ports:
      - '8888:8080'
here error ``` 2026-02-19T17:23:27.352441Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. server-1 | ConnectionRefusedError [SequelizeConnectionRefusedError]: connect ECONNREFUSED 172.19.0.3:3307 server-1 | at ConnectionManager.connect (/app/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:92:17) server-1 | at processTicksAndRejections (node:internal/process/task_queues:96:5) server-1 | at async ConnectionManager._connect (/app/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:222:24) server-1 | at async /app/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:174:32 server-1 | at async ConnectionManager.getConnection (/app/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:197:7) server-1 | at async /app/node_modules/sequelize/lib/sequelize.js:305:26 server-1 | at async Sequelize.authenticate (/app/node_modules/sequelize/lib/sequelize.js:457:5) server-1 | at async start (/app/index.js:24:9) { server-1 | parent: Error: connect ECONNREFUSED 172.19.0.3:3307 server-1 | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1133:16) { server-1 | errno: -111, server-1 | code: 'ECONNREFUSED', server-1 | syscall: 'connect', server-1 | address: '172.19.0.3', server-1 | port: 3307, server-1 | fatal: true server-1 | }, server-1 | original: Error: connect ECONNREFUSED 172.19.0.3:3307 server-1 | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1133:16) { server-1 | errno: -111, server-1 | code: 'ECONNREFUSED', server-1 | syscall: 'connect', server-1 | address: '172.19.0.3', server-1 | port: 3307, server-1 | fatal: true server-1 | } mysql-1 | 2026-02-19T17:23:31.322239Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option. ```

Please, edit your post and use code blocks in Markdown or use the </> button to starta new code block. See how I edited your first post.

But… just because you change the port in the compose yaml, MySQL will still listen on its default port, which is port 3306 so you will need to use that for internal connection.

i changed port back t6 3306 nothing happend
Here docker yml
version: ‘3’

services:
frontend:
build: ./client
ports:
- ‘3333:3000’
server:
build: ./server
depends_on:
- mysql
ports:
- ‘5555:5000’
mysql:
image: mysql:8.4
restart: always
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: author
adminer:
image: adminer
depends_on:
- mysql
ports:
- ‘8888:8080’

2026-02-20T14:17:37.448460Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
server-1 | ConnectionRefusedError [SequelizeConnectionRefusedError]: connect ECONNREFUSED 172.19.0.2:3306
server-1 | at ConnectionManager.connect (/app/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:92:17)
server-1 | at processTicksAndRejections (node:internal/process/task_queues:96:5)
server-1 | at async ConnectionManager._connect (/app/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:222:24)
server-1 | at async /app/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:174:32
server-1 | at async ConnectionManager.getConnection (/app/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:197:7)
server-1 | at async /app/node_modules/sequelize/lib/sequelize.js:305:26
server-1 | at async Sequelize.authenticate (/app/node_modules/sequelize/lib/sequelize.js:457:5)
server-1 | at async start (/app/index.js:24:9) {
server-1 | parent: Error: connect ECONNREFUSED 172.19.0.2:3306
server-1 | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1133:16) {
server-1 | errno: -111,
server-1 | code: ‘ECONNREFUSED’,
server-1 | syscall: ‘connect’,
server-1 | address: ‘172.19.0.2’,
server-1 | port: 3306,
server-1 | fatal: true
server-1 | },
server-1 | original: Error: connect ECONNREFUSED 172.19.0.2:3306
server-1 | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1133:16) {
server-1 | errno: -111,
server-1 | code: ‘ECONNREFUSED’,
server-1 | syscall: ‘connect’,
server-1 | address: ‘172.19.0.2’,
server-1 | port: 3306,
server-1 | fatal: true
server-1 | }
server-1 | }

can you tell me how to configure my.cnf in docker, I want to have a folder with the my.cnf file in the folder where docker yml is running so that it can be configured,apparently the problem is with the ip