Using the Docker Compose and Mysql failed. #13695

Closed
opened 2025-11-02 10:50:38 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @Kaotic3 on GitHub (Nov 10, 2024).

Description

As the title says, I used the docker compose files in the installation guide: https://docs.gitea.com/installation/install-with-docker

image: gitea/gitea:1.22.3

I copied and pasted them into a brand new VM, and tried to start the process. What I got was an error:

The database settings are invalid: Error 1045 (28000): Access denied for user 'gitea'@'172.18.0.3' (using password: YES)

I did a little testing to see what was going on:

969b7a4ba181 gitea/gitea:latest "/usr/bin/entrypoint…" 18 minutes ago Up 18 minutes 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp, 0.0.0.0:222->22/tcp, [::]:222->22/tcp gitea

969b7a4ba181 gitea/gitea:latest "/usr/bin/entrypoint…" 18 minutes ago Up 18 minutes 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp, 0.0.0.0:222->22/tcp, [::]:222->22/tcp gitea

docker inspect 74eac20ab5aa | grep -i ipaddress "SecondaryIPAddresses": null, "IPAddress": "", "IPAddress": "172.18.0.2",

docker inspect 969b7a4ba181 | grep -i ipaddress "SecondaryIPAddresses": null, "IPAddress": "", "IPAddress": "172.18.0.3",

I couldn't resolve this, I read the documentation, could really see a good reason for it. I googled, saw a few things, tried them, it didn't fix the issue.

Decided to test with postgres as I really don't have a preference - no issues whatsoever works straight off the documentation.

I would hazard a guess that there is some sort of error in the documentation or build for the MySql docker - but I don't know what it is.

Gitea Version

1.22.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

It's docker.

Database

MySQL/MariaDB

Originally created by @Kaotic3 on GitHub (Nov 10, 2024). ### Description As the title says, I used the docker compose files in the installation guide: https://docs.gitea.com/installation/install-with-docker image: gitea/gitea:1.22.3 I copied and pasted them into a brand new VM, and tried to start the process. What I got was an error: `The database settings are invalid: Error 1045 (28000): Access denied for user 'gitea'@'172.18.0.3' (using password: YES)` I did a little testing to see what was going on: `969b7a4ba181 gitea/gitea:latest "/usr/bin/entrypoint…" 18 minutes ago Up 18 minutes 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp, 0.0.0.0:222->22/tcp, [::]:222->22/tcp gitea` `969b7a4ba181 gitea/gitea:latest "/usr/bin/entrypoint…" 18 minutes ago Up 18 minutes 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp, 0.0.0.0:222->22/tcp, [::]:222->22/tcp gitea` `docker inspect 74eac20ab5aa | grep -i ipaddress "SecondaryIPAddresses": null, "IPAddress": "", "IPAddress": "172.18.0.2",` `docker inspect 969b7a4ba181 | grep -i ipaddress "SecondaryIPAddresses": null, "IPAddress": "", "IPAddress": "172.18.0.3",` I couldn't resolve this, I read the documentation, could really see a good reason for it. I googled, saw a few things, tried them, it didn't fix the issue. Decided to test with postgres as I really don't have a preference - no issues whatsoever works straight off the documentation. I would hazard a guess that there is some sort of error in the documentation or build for the MySql docker - but I don't know what it is. ### Gitea Version 1.22.3 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? It's docker. ### Database MySQL/MariaDB
GiteaMirror added the issue/needs-feedbacktype/bug labels 2025-11-02 10:50:38 -06:00
Author
Owner

@lunny commented on GitHub (Nov 14, 2024):

I couldn't reproduce it. Can you paste your docker compose file here.

@lunny commented on GitHub (Nov 14, 2024): I couldn't reproduce it. Can you paste your docker compose file here.
Author
Owner

@Kaotic3 commented on GitHub (Nov 14, 2024):

It was a copy paste from the link with the commented parts uncommented and a change to the password.

version: "3"

networks:
  gitea:
    external: false

services:
  server:
    image: gitea/gitea:1.22.3
    container_name: gitea
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - GITEA__database__DB_TYPE=mysql
      - GITEA__database__HOST=db:3306
      - GITEA__database__NAME=gitea
      - GITEA__database__USER=gitea
      - GITEA__database__PASSWD=gitea
    restart: always
    networks:
      - gitea
    volumes:
      - ./gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "3000:3000"
      - "222:22"
    depends_on:
      - db

  db:
    image: mysql:8
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=gitea
      - MYSQL_USER=gitea
      - MYSQL_PASSWORD=gitea
      - MYSQL_DATABASE=gitea
    networks:
      - gitea
    volumes:
      - ./mysql:/var/lib/mysql
@Kaotic3 commented on GitHub (Nov 14, 2024): It was a copy paste from the link with the commented parts uncommented and a change to the password. ``` version: "3" networks: gitea: external: false services: server: image: gitea/gitea:1.22.3 container_name: gitea environment: - USER_UID=1000 - USER_GID=1000 - GITEA__database__DB_TYPE=mysql - GITEA__database__HOST=db:3306 - GITEA__database__NAME=gitea - GITEA__database__USER=gitea - GITEA__database__PASSWD=gitea restart: always networks: - gitea volumes: - ./gitea:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - "3000:3000" - "222:22" depends_on: - db db: image: mysql:8 restart: always environment: - MYSQL_ROOT_PASSWORD=gitea - MYSQL_USER=gitea - MYSQL_PASSWORD=gitea - MYSQL_DATABASE=gitea networks: - gitea volumes: - ./mysql:/var/lib/mysql ```
Author
Owner

@lunny commented on GitHub (Nov 14, 2024):

This works for me. I just run docker compose up -d and visit HTTP://localhost:3000 and click next step.

@lunny commented on GitHub (Nov 14, 2024): This works for me. I just run `docker compose up -d` and visit HTTP://localhost:3000 and click next step.
Author
Owner

@Kaotic3 commented on GitHub (Nov 14, 2024):

If no-one else is experiencing and I don't care because I am using postgres anyway - then feel free to close - I thought I would raise it but doesn't seem like a common problem, probably some random setting somewhere buried in ubuntu.

@Kaotic3 commented on GitHub (Nov 14, 2024): If no-one else is experiencing and I don't care because I am using postgres anyway - then feel free to close - I thought I would raise it but doesn't seem like a common problem, probably some random setting somewhere buried in ubuntu.
Author
Owner

@lunny commented on GitHub (Nov 14, 2024):

I’ll go ahead and close this issue. If anyone encounters a similar problem, please feel free to reopen it.

@lunny commented on GitHub (Nov 14, 2024): I’ll go ahead and close this issue. If anyone encounters a similar problem, please feel free to reopen it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13695