# Unknown MySQL server host 'mysql'

**URL:** https://community.xibo.org.uk/t/unknown-mysql-server-host-mysql/31013
**Category:** CMS Installation
**Created:** [January 25, 2024, 1:17pm UTC](https://community.xibo.org.uk/t/unknown-mysql-server-host-mysql/31013 "2024-01-25T13:17:35Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![struebig](https://community.xibo.org.uk/letter_avatar_proxy/v4/letter/s/53a042/32.png) [@struebig](https://community.xibo.org.uk/u/struebig)
#### Post date: [January 29, 2024, 1:18pm UTC](https://community.xibo.org.uk/t/unknown-mysql-server-host-mysql/31013/5 "2024-01-29T13:18:29Z")

</div>

OK - I found the solution.

I edit the **docker-compose.yml** file and add a aliases flag for the cms-db service. Now the cms-db Container is linked in the cms-web Container again with “mysql” and everything is working as before.

And the reason it took so long for me to find the solution was: I didn’t understand how to access the default network, because the examples I found always mention a concrete docker network. So I missed the keyword “default” and my tries failed.

```auto
    cms-db:
        image: mysql:5.7
        volumes:
            - "./shared/db:/var/lib/mysql:Z"
        environment:
            - MYSQL_DATABASE=cms
            - MYSQL_USER=cms
            - MYSQL_RANDOM_ROOT_PASSWORD=yes
        mem_limit: 1g
        env_file: config.env
        restart: always
        networks:
           default:
             aliases:
                - mysql

```

---

_[View the full topic](https://community.xibo.org.uk/t/unknown-mysql-server-host-mysql/31013)._
