# Database settings are invalid?

**URL:** https://forum.gitea.com/t/database-settings-are-invalid/4492
**Category:** Install/Maintain/Configure
**Created:** [January 25, 2022, 7:51am UTC](https://forum.gitea.com/t/database-settings-are-invalid/4492 "2022-01-25T07:51:36Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![DarkTrinity](https://avatars.discourse-cdn.com/v4/letter/d/f9ae1b/32.png) [@DarkTrinity](https://forum.gitea.com/u/DarkTrinity)
#### Post date: [January 25, 2022, 7:51am UTC](https://forum.gitea.com/t/database-settings-are-invalid/4492/1 "2022-01-25T07:51:36Z")

</div>

Hello dear community,

I have created a Gitea server via a Docker container on a test instance (VirtualBox) - everything works wonderfully here.  
Now I want to do the same on my web server but I get the following error message in the setup:

> Database settings are invalid: dial tcp 172.21.0.2:3306: connect: connection timed out

I would like to use the host’s database - on Virtualbox it worked with this IP. Port 3306 + 3300 is free in the FW, the access data to the database is also correct and I have now even allowed the user access from any host - but the error message simply does not change 😡

```auto
/etc/gitea# cat docker-compose.yml
    version: '3'
    networks:
      gitea:
        external: false
    volumes:
      gitea:
        driver: local
    services:   
      server:
        image: gitea/gitea:1.13.6
        container_name: gitea
        environment:
          - DB_TYPE=mysql
          - DB_HOST=172.21.0.2
          - DB_NAME=DBNAME
          - DB_USER=DBUSER
          - DB_PASSWD=DBPW
        restart: always
        networks:
          - gitea
        volumes:
          - /var/www/clients/clientx/weby/private/giteadata/data:/data
          - /var/www/clients/clientx/weby/private/giteadata/config:/config
          - /etc/timezone:/etc/timezone:ro
          - /etc/localtime:/etc/localtime:ro
          - /var/run/mysqld:/var/run/mysqld
        ports:
          - "3300:3000"
          - "222:22"

```

Since port 3000 is already occupied for Rocketchat, I switched to 3300 - everything works wonderfully on Virtualbox ^^

The Apache conf as follows:

```auto
## gitea
<Proxy *>
         Order allow,deny
        Allow from all
  </Proxy>
AllowEncodedSlashes NoDecode
# Note: no trailing slash after either /git or port
ProxyPass /git http://127.0.0.1:3300 nocanon
    ProxyPassReverse /git http://127.0.0.1:3300     

```

Whats going on here ? Many thanks in advance

---

<div class="post-metadata">

### Author: ![techknowlogick](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/techknowlogick/32/4706_2.png) [@techknowlogick](https://forum.gitea.com/u/techknowlogick)
#### Post date: [January 25, 2022, 9:05pm UTC](https://forum.gitea.com/t/database-settings-are-invalid/4492/2 "2022-01-25T21:05:17Z")

</div>

You are using a significantly out of date version of Gitea ( `1.13.6`), please instead update to latest stable (at time of writing it is `1.15.10` soon to be `1.16.0`)

---

<div class="post-metadata">

### Author: ![DarkTrinity](https://avatars.discourse-cdn.com/v4/letter/d/f9ae1b/32.png) [@DarkTrinity](https://forum.gitea.com/u/DarkTrinity)
#### Post date: [January 29, 2022, 10:04am UTC](https://forum.gitea.com/t/database-settings-are-invalid/4492/3 "2022-01-29T10:04:37Z")

</div>

Hi, thanks but on another mashine this old version does a very well job.

Now I changed the yml to the new version, pulled again, tried teh setup - same error (of course)

---

<div class="post-metadata">

### Author: ![DarkTrinity](https://avatars.discourse-cdn.com/v4/letter/d/f9ae1b/32.png) [@DarkTrinity](https://forum.gitea.com/u/DarkTrinity)
#### Post date: [January 29, 2022, 10:28am UTC](https://forum.gitea.com/t/database-settings-are-invalid/4492/4 "2022-01-29T10:28:41Z")

</div>

isn’t there a log to examine ? i started getting sick and tired of repeating and repeating the same steps which just cannot work…

why was that working exactliy tzhis way on test-server on virtual box and wjhy does not work in a webserver ???

Can I somehow remove the gitea completely with all files, configs and everything (without affecting other docker images running) and just reinstall new ?

---

<div class="post-metadata">

### Author: ![DarkTrinity](https://avatars.discourse-cdn.com/v4/letter/d/f9ae1b/32.png) [@DarkTrinity](https://forum.gitea.com/u/DarkTrinity)
#### Post date: [January 29, 2022, 4:27pm UTC](https://forum.gitea.com/t/database-settings-are-invalid/4492/5 "2022-01-29T16:27:19Z")

</div>

I got it now - somehow the containers IP address was different to the one on my other mashine. I changed the IPs and all working now.

Identified IP of container by executing:

```auto
docker inspect <Container> | grep -i ipaddress	

```

It gave me 172.20.0.2. Then I changed the DB-IP in the yml to 172.20.0.1 - all good now

How can I mark this thread as solved ?

---

<div class="post-metadata">

### Author: ![michael-sparrow](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/michael-sparrow/32/7042_2.png) [@michael-sparrow](https://forum.gitea.com/u/michael-sparrow)
#### Post date: [August 7, 2025, 7:43am UTC](https://forum.gitea.com/t/database-settings-are-invalid/4492/6 "2025-08-07T07:43:18Z")

</div>

Thank you for posting the solution
